Exam 8: Text Processing and Wrapper Classes

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

What will be the value of position after the following code is executed? Int position; String str = "The cow jumped over the moon."; Position = str.lastIndexOf("ov", 14);

Free
(Multiple Choice)
4.9/5
(33)
Correct Answer:
Verified

D

Most of the String comparison methods are case sensitive.

Free
(True/False)
4.9/5
(42)
Correct Answer:
Verified

True

A wrapper class is a class that is "wrapped around" a primitive data type and allows you to create objects instead of variables.

Free
(True/False)
4.7/5
(46)
Correct Answer:
Verified

True

If a string has more than one character used as a delimiter, we must write a loop to determine the tokens, one for each delimiter character.

(True/False)
4.9/5
(36)

StringBuilder objects are not immutable.

(True/False)
4.8/5
(38)

Which of the following statements converts a String object variable named str to an int and stores the value in the variable x?

(Multiple Choice)
4.8/5
(37)

Which of the following statements converts a double variable named tax to a string and stores the value in the String object variable named str?

(Multiple Choice)
4.8/5
(40)

What will be displayed after the following code is executed? String str = "RSTUVWXYZ"; System.out.println(str.charAt(5));

(Multiple Choice)
4.7/5
(42)

Which of the following import statements is required to use the Character wrapper class?

(Multiple Choice)
4.7/5
(37)

What will be displayed after the following code is executed? String str = "abc456"; For (int i = 0; i < str.length(); i++) { Char chr = str.charAt(i); If (!Character.isLetter(chr)) System.out.print(Character.toUpperCase(chr)); }

(Multiple Choice)
4.9/5
(41)

Trying to extract more tokens than exist from a StringTokenizer object will cause an error.

(True/False)
4.8/5
(44)

What will be the value of position after the following code is executed? Int position; String str = "The cow jumped over the moon."; Position = str.indexOf("ov");

(Multiple Choice)
4.8/5
(30)

You can concatenate String objects by

(Multiple Choice)
4.8/5
(41)

In the following statement, what data type must recField be? Str)getChars(5, 10, recField, 0);

(Multiple Choice)
4.9/5
(35)

What will be displayed after the following code has been executed? String str1 = "The quick brown fox jumped over the lazy dog."; String str2 = str1.substring(20, 26); System.out.println(str2);

(Multiple Choice)
4.9/5
(36)

Which of the following statements is not true about the following code? StringBuilder strb = New StringBuilder("Total number of parts: "); Strb.insert(23, 32);

(Multiple Choice)
4.9/5
(39)

Which of the following are used as delimiters if the StringTokenizer class's constructor is called and a reference to a String object is passed as the only argument?

(Multiple Choice)
4.8/5
(38)

The String class's regionMatches method performs a case-insensitive comparison.

(True/False)
4.8/5
(35)

The ________ class is the wrapper class for the char data type.

(Multiple Choice)
4.9/5
(43)

When working with the String and StringBuilder class's getChars method, the character at the start position is included in the substring, but the character at the end position is not included.

(True/False)
4.9/5
(32)
Showing 1 - 20 of 40
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)