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 1
Multiple Choice
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") ;
Question 2
Multiple Choice
If your program needs to make a lot of changes to one or more string, you might consider using objects of this class:
Question 3
Multiple Choice
Which of the following methods of the String class can be used to tokenize a string?
Question 4
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 5
Multiple Choice
In the following statement, what data type must recField be? Str) getChars(5, 10, recField, 0) ;
Question 6
Multiple Choice
What will be the tokens for the following code? String str = "123-456-7890"; String[] tokens = str.split("-") ;
Question 7
Multiple Choice
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.
Question 8
Multiple Choice
Sometimes a string will contain a series of words or other items of data separated by spaces or other characters. In programming terms, items such as these are known as what?
Question 9
Multiple Choice
When using the StringBuilder class's insert method, you can insert:
Question 10
Multiple Choice
What is the term used for the character that separates tokens?
Question 11
Multiple Choice
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) ;
Question 12
Multiple Choice
Assuming that str is declared as follows: String str = "RSTUVWXYZ"; What value will be returned from str.charAt(5) ?
Question 13
Multiple Choice
Look at the following statement: StringBuilder str = new StringBuilder(25) ; What will the StringBuilder constructor do?
Question 14
Multiple Choice
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") ;
Question 15
Multiple Choice
The Character wrapper class provides numerous methods for:
Question 16
Multiple Choice
What is term used for a class that is "wrapped around" a primitive data type and allows you to create objects instead of variables?
Question 17
Multiple Choice
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") ;