Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Starting Out with Java
Quiz 9: Text Processing and More About Wrapper Classes
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 21
Multiple Choice
For the following code, how many times would the for loop execute? String str = "1,2,3,4,5,6,7,8,9") ; String[] tokens = str.split(",") ; For (String s : tokens) System.out.println(s) ;
Question 22
Multiple Choice
The no-arg constructor for a StringBuilder object gives the object enough storage space to hold this many characters.
Question 23
Multiple Choice
This is the process of converting a wrapper class object to a primitive type.
Question 24
Multiple Choice
Each of the numeric wrapper classes has a static ________ method that converts a number to a string.
Question 25
Multiple Choice
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.") ;
Question 26
Multiple Choice
If str is declared as: String str = "ABCDEFGHI"; What will be returned from Character.toLowerCase(str.charAt(5) ) ?
Question 27
Multiple Choice
Given the following statement, which of the following is NOT true? Str) insert(8, 32) ;
Question 28
Multiple Choice
Two ways of concatenating two Strings are:
Question 29
Multiple Choice
For the following code, how many times would the for loop execute? String str = ("Ben and Jerry's ice cream is great.") ; String[] tokens = str.split(" ") ; For (String s : tokens) System.out.println(s) ;
Question 30
Multiple Choice
What will be the tokens given the following statements? String str = ("January 1, 2016") ; String[] tokens = str.split(" ") ;
Question 31
Multiple Choice
When using the String class's trim method, which of the following cannot be trimmed?
Question 32
Multiple Choice
To convert the string, str = "285.74" to a double, use the following statement:
Question 33
Multiple Choice
Use the following import statement when using the Character wrapper class:
Question 34
Multiple Choice
What does the following statement do? Double number = new Double(8.8) ;
Question 35
Multiple Choice
Which of the following statements will print the maximum value a double variable may have?
Question 36
Multiple Choice
To convert the int variable, number to a string, use the following statement:
Question 37
Multiple Choice
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++; }
Question 38
Multiple Choice
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) ;