Exam 9: Text Processing and More About Wrapper Classes

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

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

(True/False)
4.9/5
(78)

To convert the string, str = "285" to an int, use the following statement:

(Multiple Choice)
5.0/5
(64)

Which of the following statements will print the maximum value a double variable may have?

(Multiple Choice)
4.8/5
(81)

What will be the tokens given the following statements? String str = ("January 1, 2016"); String[] tokens = str.split(" ");

(Multiple Choice)
4.8/5
(72)

What will be printed after the following code is executed? String str = "abc456"; Int m = 0; While ( m < 6 ) { If (Character.isLetter(str.charAt(m))) System.out.print( Character.toUpperCase(str.charAt(m))); M++; }

(Multiple Choice)
4.8/5
(84)

For the following code, how many times would the for loop execute? String str = "1,2,3,4,5,6,7,8,9"); String[] tokens = str.split(","); For (String s : tokens) System.out.println(s);

(Multiple Choice)
4.9/5
(77)

If you are using characters other than whitespaces as delimiters, you will probably want to trim the string before tokenizing; otherwise, the leading and/or following whitespaces will become part of the first and/or last token.

(True/False)
4.7/5
(72)

Which of the following methods of the String class can be used to tokenize a string?

(Multiple Choice)
4.8/5
(93)

If a non-letter argument is passed to the toLowerCase or toUpperCase method, the boolean value False is returned.

(True/False)
4.8/5
(73)

You can change the contents of a StringBuilder object, but you cannot change the contents of a String object.

(True/False)
4.8/5
(66)

The Character wrapper class provides numerous methods for:

(Multiple Choice)
4.8/5
(93)

To convert the int variable, number to a string, use the following statement:

(Multiple Choice)
4.8/5
(87)

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

(Multiple Choice)
4.8/5
(72)

When using the String class's trim method, which of the following cannot be trimmed?

(Multiple Choice)
4.8/5
(69)

You cannot assign a value to a wrapper class object.

(True/False)
4.9/5
(74)

Use the following import statement when using the Character wrapper class:

(Multiple Choice)
5.0/5
(93)

The String class's valueOf() method accepts a value of any primitive data type as an argument and returns a string representation of the value.

(True/False)
4.7/5
(79)

Two ways of concatenating two Strings are:

(Multiple Choice)
4.8/5
(70)

Autoboxing is:

(Multiple Choice)
4.8/5
(93)

For the following code, how many times would the for loop execute? String str = ("Ben and Jerry's ice cream is great."); String[] tokens = str.split(" "); For (String s : tokens) System.out.println(s);

(Multiple Choice)
4.8/5
(71)
Showing 21 - 40 of 60
close modal

Filters

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