Exam 14: Strings, Characters and Regular Expressions

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

How many String objects are instantiated by the following code segment (not including the literals)? String s1, output; S1 = "hello"; Output = "\nThe string reversed is: " ; For (int i = s1.length() - 1; i >= 0; i--) Output += s1.charAt(i) + " " ;

(Multiple Choice)
4.7/5
(39)

Consider the Java segment: String line1 = new String("c = 1 + 2 + 3") ; StringTokenizer tok = new StringTokenizer(line1); Int count = tok.countTokens(); The value of count is ________.

(Multiple Choice)
4.9/5
(37)

Which of the following creates the string of the numbers from 1 to 1000 most efficiently?

(Multiple Choice)
4.8/5
(36)

Consider the String below: String r = "a toyota"; Which of the following will create the String r1 = "a TOYOTa"?

(Multiple Choice)
4.9/5
(34)

Which of the following will create a String different from the other three?

(Multiple Choice)
4.9/5
(34)

String objects are immutable. This means they ________.

(Multiple Choice)
4.8/5
(37)
Showing 21 - 26 of 26
close modal

Filters

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