Exam 8: Text Processing and Wrapper Classes

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

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

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

C

What will be displayed after the following code is executed? StringBuilder strb = new StringBuilder(12); Strb.append("The cow "); Strb.append("jumped over the "); Strb.append("moon."); System.out.println(strb);

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

B

A series of words or other items of data, separated by spaces or other characters, are known as

Free
(Multiple Choice)
4.8/5
(80)
Correct Answer:
Verified

B

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

(True/False)
4.9/5
(83)

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

(Multiple Choice)
4.8/5
(82)

The StringBuilder class's insert method allows you to insert a(n) __________ into the calling object's string.

(Multiple Choice)
4.9/5
(90)

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

(True/False)
4.7/5
(79)

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

(Multiple Choice)
4.8/5
(77)

You cannot assign a value to a wrapper class object.

(True/False)
4.9/5
(90)

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

(Multiple Choice)
4.8/5
(86)

What will be displayed after the following code is 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
(86)

When working with the String and StringBuilder classes' 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.8/5
(76)

What are the tokens in the following statement? StringTokenizer st = new StringTokenizer("9-14-2018", "-", true);

(Multiple Choice)
4.9/5
(74)

Any ___________ argument passed to the Character class's toLowerCase method or toUpperCase method is returned as it is.

(Multiple Choice)
4.8/5
(80)

The String class's valueOf method accepts a string representation as an argument and returns its equivalent integer value.

(True/False)
4.8/5
(77)

Which of the following is(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.9/5
(73)

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
(68)

What will be displayed after the following statements are executed? StringBuilder strb = new StringBuilder("We have lived in Chicago, Trenton, and Atlanta."); Strb.replace(17, 24, "Tampa"); System.out.println(strb);

(Multiple Choice)
4.8/5
(68)

StringBuilder objects are not immutable.

(True/False)
4.9/5
(75)

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.8/5
(85)
Showing 1 - 20 of 40
close modal

Filters

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