Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions