Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the return type of the String class toUpperCase() method? (3 points) Question 1 options: 1) int 2) double 3) boolean 4) String 5)

What is the return type of the String class toUpperCase() method? (3 points)

Question 1 options:

1)

int

2)

double

3)

boolean

4)

String

5)

void

Question 2 (3 points)

Assume the String objects word1 and word2 are initialized as shown below. What is the value of the expression word1.equalsIgnoreCase(word2)? (3 points)

String word1 = "Internet"; String word2 = "internet";

Question 2 options:

1)

1

2)

0

3)

1

4)

True

5)

False

Question 3 (3 points)

What is the result of the following code segment? (3 points)

String word = "sunflower"; String x = word.substring(3); String y = word.substring(3, 9); if( x == y) System.out.print(1); else if( x.equals(y)) System.out.print(2); else System.out.print(3);

Question 3 options:

1)

1

2)

2

3)

3

4)

12

5)

13

Question 4 (3 points)

Assume the String objects x and y are initialized as shown below. What is the value of the expression word2.compareTo(word1)? (3 points)

String word1 = "busy"; String word2 = "be";

Question 4 options:

1)

1

2)

0

3)

1

4)

A negative integer

5)

A positive integer

Question 5 (3 points)

Which of the following expressions will evaluate to true? (3 points)

I. "Samira".equals("Sami") II. "SAMI".compareTo("Samira") < 0 III. "Sami".compareTo("SAMI") < 0

Question 5 options:

1)

I only

2)

II only

3)

III only

4)

I and II only

5)

I and III only

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Describe the controversy over Skinners views of human behavior.

Answered: 1 week ago

Question

i need correct answrrs 5 2 2 .

Answered: 1 week ago