Question: 5 quick java questions. Thanks to whomever helps! 1. Identify the false statement. a. Character, String, and StringBuilder are useful built-in classes for working with

5 quick java questions. Thanks to whomever helps!

1. Identify the false statement.

a. Character, String, and StringBuilder are useful built-in classes for working with text data.
b. Programmers want to compare the values of Strings more frequently than they want to compare their memory addresses.
c. A String is a simple data type that can hold text data.

2. Identify the false statement.

a. Character is a class, but char is a simple data type.
b. If a char variable holds the Unicode value for the Tab key, isWhitespace() would be true and isLetterOrDigit() would be false.

c. The Character class method isLowerCase() returns the lowercase version of any uppercase character.

3. Identify the false statement.

a. To create a String object, you must use the keyword new and explicitly call the class constructor.
b. When you compare Strings with the equals() method, you are comparing their values, not their memory addresses.
c. When you compare Strings with the == operator, you are comparing their memory addresses, not their values.

4. Identify the false statement.

a. Assume that myName is a String defined as "molly". The value of myName.toUpperCase() is "Molly".
b. Assume that myName is a String defined as "molly". The value of myName.indexOf('M') is 1.
c. Assume that myName is a String defined as "molly". The value of myName.length() is "5".

5. Identify the false statement.

a. When you create a String, you have the option of omitting the keyword new, but when you initialize a StringBuilder object, you must use the keyword new, the constructor name, and an initializing value between the constructor's parentheses.
b. If a StringBuilder named myAddress contains "817", then myAddress.append(" Maple Lane"); alters myAddress to contain "817 Maple Lane".
c. When you create a StringBuilder object with an initial value of "Juan", its capacity is 16.

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!