Question: A) Declare a String variable called myString0 and initialize it to Java. B) Declare a String variable called myString1 and initialize it to Programming. C)

A) Declare a String variable called myString0 and initialize it to "Java".

B) Declare a String variable called myString1 and initialize it to "Programming".

C) Declare a String variable called myString2 and initialize it to "Language".

D) Print the concatenation of myString0 + " is a " + myString1 + " " + myString2 + ".".

E) Print the sum of the lengths of myString1 and MyString2 (must call the length() method).

F) Print the 2nd, 4th, and 7th character of myString1 (must use the charAt() method), separated by commas.

G) Print the index of 'a' in myString0 (must use the indexOf() method).

H) Print myString2 converted to uppercase (must use the toUpperCase() method).

I) Print the 3rd through 8th character of myString1 (must use the substring() method).

J) Declare a String called myString3 and set it to "Whatever!", you must use the 'new' operator.

K) Declare a String called myString4 and set it to "Whatever!", you must use the 'new' operator.

L) Print a comparison of the two strings using (myString3 == myString4).

M) Print a comparison of the two strings using (myString3.equals(myString4)).

N) Declare three char variables c0, c1, and c2 with the values '^', 'G', and '7'.

O) Print the characters, separated by semicolons.

P) Print the ASCII value of the characters, separated by commas. HINT: Use a typecast of the character from char to int.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!