String in Java

String in Java

University

20 Qs

quiz-placeholder

Similar activities

Array Java

Array Java

University

15 Qs

OOP - Quiz

OOP - Quiz

University

15 Qs

Java Script

Java Script

University

15 Qs

QUIZ DASAR DASAR PEMROGRAMAN JAVA

QUIZ DASAR DASAR PEMROGRAMAN JAVA

11th Grade - University

20 Qs

Java thread - MCQ

Java thread - MCQ

University

18 Qs

Java Programming I 2

Java Programming I 2

University

19 Qs

Java Quiz 1

Java Quiz 1

University

20 Qs

String in Java

String in Java

Assessment

Quiz

Computers

University

Hard

Created by

KarunaiMuthu SriRam

Used 18+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

There is a companion class to string called ………………….., whose objects contain strings that can be modified after they are created.

stringBuffer

stringClass

toString( )

stringChar

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Consider the following code,

string s=new String(); will create an instance of string with

at least one character

a default character

no characters in it

number of characters in it

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

…………………. returns a sting that contains the human-readable equivalent of the value with which it is called.

toValue()

value()

valueOf()

getValue()

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

…………………… method simply return a string that appropriately describes an object of your class.

getChars()

toString()

toCharArray()

getString()

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

To extract a single character from a sting, you can refer directly to an individual character via the …………………… method.

charAt()

getChars()

getCharAt()

getAt()

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

If you need to extract more than one character at a time, you can use the …………………………. .

getBytes()

charAt()

getChars()

getString()

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

If S1 and S2 are two strings, which of the following statements or expressions are correct.

i) String S3=S1+S2;

ii) String S3=S1-S2;

iii) S1<=S2;

iv) S1.compareTo(S2);

i and ii only

ii and iii only

ii and iv only

i and iv only

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?