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
Java Early Objects Study Set 1
Quiz 8: Text Processing and Wrapper Classes
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 21
Multiple Choice
The String class's __________ method accepts a value of any primitive data type as its argument and returns a string representation of the value.
Question 22
Multiple Choice
What will be displayed after the following statements are executed? String str = "red$green&blue#orange"; String[] tokens = str.split("[$]") ; For (String s : tokens) System.out.print(s + " ") ;
Question 23
Multiple Choice
The __________ class is the wrapper class for the char data type.
Question 24
Multiple Choice
Which of the following statements is not true about the following code? StringBuilder strb = new StringBuilder("Total number of parts: ") ; Strb.insert(23, 32) ;
Question 25
Multiple Choice
What will be the value of position after the following code is executed? int position; String str = "The cow jumped over the moon."; Position = str.indexOf("ov") ;
Question 26
Multiple Choice
In the following statement, what data type must recField be? str.getChars(5, 10, recField, 0) ;
Question 27
Multiple Choice
What will be the value of position after the following code is executed? int position; String str = "The cow jumped over the moon."; Position = str.lastIndexOf("ov", 14) ;
Question 28
Multiple Choice
The StringBuilder class's insert method allows you to insert a(n) __________ into the calling object's string.
Question 29
Multiple Choice
What are the tokens in the following statement? StringTokenizer st = new StringTokenizer("9-14-2018", "-", true) ;
Question 30
Multiple Choice
You can concatenate String objects by using the
Question 31
Multiple Choice
Which of the following is(are) used as delimiters if the StringTokenizer class's constructor is called and a reference to a String object is passed as the only argument?
Question 32
Multiple Choice
What will be displayed after the following code is executed? String str = "abc456"; For (int i = 0; i < str.length() ; i++) { Char chr = str.CharAt(i) ; If (!Character.isLetter(chr) ) System.out.print(Character.toUpperCase(chr) ) ; }
Question 33
Multiple Choice
Any ___________ argument passed to the Character class's toLowerCase method or toUpperCase method is returned as it is.
Question 34
Multiple Choice
What will be displayed after the following statements are executed? StringBuilder strb = new StringBuilder("We have lived in Chicago, Trenton, and Atlanta.") ; Strb.replace(17, 24, "Tampa") ; System.out.println(strb) ;
Question 35
Multiple Choice
Given the following code, how many times will the while loop be executed? StringTokenizer st = new StringTokenizer("Java programming is fun!") ; While (st.hasMoreTokens() ) System.out.println(st.nextToken() ) ;