Exam 10: Text Processing and More About Wrapper Classes

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

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

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

C

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

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

C

What will be the value of str after the following statements are executed? StringBuilder str = New StringBuilder("We have lived in Chicago," + "Trenton,and Atlanta."); Str)replace(17,24,"Tampa");

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

A

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.

(Multiple Choice)
4.8/5
(36)

Two ways of concatenating two Strings are

(Multiple Choice)
4.8/5
(35)

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

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

(True/False)
4.9/5
(40)

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 spaces or other characters is

(Multiple Choice)
4.8/5
(32)

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

Given the following statement,which of the following is not true? str.insert(8,32);

(Multiple Choice)
4.7/5
(32)

If str is declared as String str = "ABCDEFGHI"; What will be returned from Character.toLowerCase(str.charAt(5))?

(Multiple Choice)
4.9/5
(38)

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

(Multiple Choice)
4.7/5
(38)

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

(Multiple Choice)
4.8/5
(40)

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

(Multiple Choice)
4.9/5
(47)

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

To use the StringTokenizer class you must have the following import statement.

(Multiple Choice)
4.8/5
(37)

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

(Multiple Choice)
4.8/5
(45)

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

(Multiple Choice)
4.9/5
(43)

If a non-letter is passed to the toLowerCase or toUpperCase method,it is returned unchanged.

(True/False)
4.8/5
(37)

Use the following import statement when using the Character wrapper class

(Multiple Choice)
4.8/5
(30)
Showing 1 - 20 of 49
close modal

Filters

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