Search Header Logo

Strings

Authored by Francesca [Student]

Computers

11th Grade

Used 3+ times

Strings
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

append is a method in the StringBuffer class

True

False

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

append is a method in the String class

true

false

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You cannot call a literal string's methods, as in "Hello".equals(str).

True

False

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given

String word1 = "at";

String word2 = "Cat";

what is returned by word2.compareTo(word1)?

A negative integer

false

true

A positive integer

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The Character class contains the static method boolean isUpperCase(char ch).

True

False

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if str.length() is 8 and you call str.charAt(8)?

charAt returns the random character that happens to be stored after the string.

You get a StringIndexOutOfBoundsException.

charAt returns the last character of str.

charAt returns -1.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The length method returns 0 for an empty string.

True

False

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?