Search Header Logo

Java String class methods

Authored by Claire Firman

Computers

10th - 12th Grade

Used 40+ times

Java String class methods
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

Which method would you use to check if two Strings are exactly the same?

equals()

equalsIgnoreCase()

toUpperCase()

toLowerCase()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method would you use to see if two Strings contain the same letters but ignoring capitals and small letters?

equals()

equalsIgnoreCase()

toUpperCase()

compareTo()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method was used to convert this String: "IT learners are clever" to "IT LEARNERS ARE CLEVER" ?

toUpperCase()

toLowerCase()

equalsIgnoreCase()

compareTo()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method was used to convert this String: "Life is TOO SHORT to be BORED" to: "life is too short to be bored" ?

toLowerCase()

toUpperCase()

equals()

equalsIgnoreCase()

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

True or False:

("Andy".compareTo("Andrew") > 0)

True

False

6.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Good or Bad Java:

if (greeting == "hello")

Good

Bad

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will print?

if ("Mac".compareTo("Mug") > 0)

System.out.println("Mac comes before Mug")

nothing

Mac comes before Mug

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?