Exam 10: Text Processing and More About Wrapper Classes

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

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.8/5
(38)

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.8/5
(41)

What does the following statement do? Double number = new Double(8.8);

(Multiple Choice)
4.9/5
(37)

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

(Multiple Choice)
4.9/5
(38)

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

(True/False)
4.9/5
(35)

You cannot assign a value to a wrapper class object.

(True/False)
4.9/5
(37)

In a string that contains a series of words or other items of data separated by spaces or other characters,the programming term for the data items is

(Multiple Choice)
4.8/5
(43)

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

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

(True/False)
4.7/5
(37)

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

For the following code,how many times would the while loop execute? StringTokenizer strToken = New StringTokenizer("Cars,trucks,and SUVs " + "are all types of automobiles."); While (strToken.hasMoreTokens()) { System.out.println(strToken.nextToken()); }

(Multiple Choice)
4.7/5
(30)

The Character wrapper class provides numerous methods for

(Multiple Choice)
4.8/5
(42)

StringBuilder objects are immutable.

(True/False)
4.8/5
(39)

When using the StringBuilder class's insert method,you can insert

(Multiple Choice)
4.9/5
(45)

The StringBuilder constructor used in the following statement will... StringBuilder str = new StringBuilder(25);

(Multiple Choice)
4.9/5
(38)

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

(Multiple Choice)
4.8/5
(41)

What will be the tokens in the following statement? StringTokenizer strToken = new StringTokenizer("123-456-7890", "-",true);

(Multiple Choice)
4.8/5
(37)

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

(Multiple Choice)
4.9/5
(39)

Assuming that str is declared as follows, String str = "RSTUVWXYZ"; What value will be returned from str.charAt(5)?

(Multiple Choice)
5.0/5
(33)

If you do not specify delimiters in the StringToken constructor,which of the following cannot be a delimiter?

(Multiple Choice)
4.9/5
(33)
Showing 21 - 40 of 49
close modal

Filters

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