Exam 10: Text Processing and More About Wrapper Classes

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

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.indexOf("ov");

(Multiple Choice)
4.8/5
(34)

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

(Multiple Choice)
4.8/5
(34)

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

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

What will be the tokens in the following statement? StringTokenizer strToken = New StringTokenizer("January 1,2008",",",true);

(Multiple Choice)
4.9/5
(47)

For the following code,how many times would the while loop execute? StringTokenizer strToken = New StringTokenizer("Ben and Jerry's ice cream is great."); While (strToken.hasMoreTokens()) { System.out.println(strToken.nextToken()); }

(Multiple Choice)
4.7/5
(40)

What will be the value of matches after the following code is executed? boolean matches; String[] productCodes = {"456HI345","3456hj"}; Matches = productCodes[0].regionMatches(true,1, ProductCodes[1],2,3);

(Multiple Choice)
4.8/5
(42)

You must call a method to get the value of a wrapper class object.

(True/False)
4.9/5
(33)

What would be the results of executing the following code? StringBuilder str = new StringBuilder(12); Str)append("The cow"); Str)append(" jumped over the "); Str)append("moon.");

(Multiple Choice)
4.7/5
(39)
Showing 41 - 49 of 49
close modal

Filters

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