Exam 9: Text Processing and More About Wrapper Classes

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

When you are writing a program with String objects that may have unwanted spaces at the beginning or end of the strings, use this method to delete them.

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

B

The term ________ commonly is used to refer to a string that is part of another string.

Free
(Multiple Choice)
4.7/5
(41)
Correct Answer:
Verified

B

This is the process of converting a wrapper class object to a primitive type.

Free
(Multiple Choice)
5.0/5
(35)
Correct Answer:
Verified

B

Which of the following statements will print the maximum value an int variable may have?

(Multiple Choice)
4.9/5
(46)

Look at the following code. Integer myNumber; MyNumber = 5; Which of the following is TRUE about the second statement?

(Multiple Choice)
4.9/5
(43)

To convert the double variable, d = 543.98, to a string, use the following statement:

(Multiple Choice)
4.8/5
(40)

What is the value of str after the following code has been executed? String str; String sourceStr = "Hey diddle, diddle, the cat and the fiddle"; Str = sourceStr.substring(12,17);

(Multiple Choice)
4.9/5
(29)

The process of breaking a string down into tokens is known as what?

(Multiple Choice)
4.9/5
(36)

To convert the string, str = "285.74" to a double, use the following statement:

(Multiple Choice)
4.8/5
(37)

Look at the following code: Integer myNumber = new Integer(5); Int var = myNumber; Which of the following is TRUE about the second statement?

(Multiple Choice)
4.9/5
(36)

What will be the value of matches after the following code has been executed? Boolean matches; String str1 = "The cow jumped over the moon."; String str2 = "moon"; Matches = str1.endsWith(str2);

(Multiple Choice)
4.8/5
(34)

What is the term used for the character that separates tokens?

(Multiple Choice)
4.8/5
(36)

This character is one that appears at the end, or right side, of a string, after the non-space characters:

(Multiple Choice)
4.8/5
(35)

Look at the following statement: StringBuilder str = new StringBuilder(25); What will the StringBuilder constructor do?

(Multiple Choice)
4.8/5
(34)

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.9/5
(39)

Sometimes a string will contain a series of words or other items of data separated by spaces or other characters. In programming terms, items such as these are known as what?

(Multiple Choice)
4.7/5
(34)

The no-arg constructor for a StringBuilder object gives the object enough storage space to hold this many characters.

(Multiple Choice)
4.9/5
(40)

What would be the results of executing the following code? StringBuilder str = new StringBuilder("Little Jack Horner "); Str)append("sat on the "); Str)append("corner");

(Multiple Choice)
4.8/5
(42)

What will be the tokens in the following statement? String str = "red$green&blue#orange"; String[] tokens = str.split("[$&#]");

(Multiple Choice)
4.8/5
(46)

The following statement correctly creates a StringBuilder object. StringBuilder str = "Caesar Salad";

(True/False)
4.8/5
(33)
Showing 1 - 20 of 60
close modal

Filters

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