Search Header Logo

java String StringBuffer

Authored by A Vijay Kumar

Computers

University

Used 16+ times

java String StringBuffer
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following print?

System.out.println( "And yet, it moves!".charAt(0) );

A

n

!

The statement is incorrect.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following print?

String str = "And yet, it moves!"

System.out.println( str.charAt( str.length() ) );

A

n

!

The statment is incorrect.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Examine the following fragment:

String cat = "Hello"


cat += " ";

cat += "World" ;

How many objects are constructed?

0

1

2

3

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Examine the following fragment:

String world = "World!";

StringBuffer buf = new StringBuffer( "Hello" );


buf.append(' ');

buf.append( world );

How many StringBuffer objects are constructed?

0

1

2

3

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which phrase best describes a String object after it has been constructed?

Changeable

Write Only

Read Only

Inaccessible

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which character of a StringBuffer has index 0?

leftmost

rightmost

no character

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

After a StringBuffer has been constructed, how many characters may be added to it?

No more after it has been constructed.

Only as many as the original capacity.

As many as needed; it will grow in size if necessary.

A new StringBuffer must be constructed each time characters are added.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers