Text Processing
The no-arg constructor for a StringBuilder object gives the object enough storage space to hold __________ characters. Question options: 0 8 16 32
16
What are the tokens in the following statement? StringTokenizer st = new StringTokenizer("9-14-2018"", "-"", true); Question options: 9, 14, 2018 - 9, 14, 2018, - None of these
9, 14, 2018, -
(true/false) The wrapper classes in Java are immutable, which means that once you create an object, you cannot change the object's value.
True
(true/false) You can change the contents of a StringBuilder object, but you cannot change the contents of a String object.
True
The term used for the character that separates tokens is __________. Question options: tokenizer delimiter whitespace separator
delimiter
What is the value of str after the following code has been executed? String str; String sourceStr = """Hey diddle"," diddle"," the cat and the fiddle"""; str = sourceStr.substring(12","17); Question options: diddle diddl didd iddle
diddl
If str is declared as: String str = "ABCDEFGHI"; What will be returned from the following statement? Character.toLowerCase(str.charAt(5)); Question options: e E f F
f
(true/false)The following statement correctly creates a StringBuilder object. StringBuilder str = "Tuna sandwich";
false
Which of the following statements will convert the string str = "285" to an int? Question options: int x = str; int x = Integer.parseInteger(str); int x = Integer.integer(str); int x = Integer.parseInt(str);
int x = Integer.parseInt(str);
Any ___________ argument passed to the Character class's toLowerCase method or toUpperCase method is returned as it is. Question options: nonletter char string static
nonletter
The term __________ is commonly used to refer to a string that is part of another string. Question options: nested string literal substring delimiter
substring
A series of words or other items of data, separated by spaces or other characters, is known as a __________. Question options: string token delimiter caption
token
The ________ character appears at the end (the right side) of a string, after the non-space characters. Question options: leading whitespace trailing whitespace character return line feed
trailing whitespace
The __________ method returns a copy of the calling String object with all leading and trailing whitespace characters deleted. Question options: remove trim compress concat
trim
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 options: trim getChar toString valueOf
valueOf
The __________ method of the String class can be used to tokenize a string. Question options: split tokenize trim length
Split
Which of the following statements will display the maximum value that a double can hold? Question options: System.out.println(Double.MAX_VALUE); System.out.println(Double.MAXIMUM_VALUE); System.out.println(Double.MAX_VAL); System.out.println(<double>(MAX_VALUE));
System.out.println(Double.MAX_VALUE);
Which of the following statements will print the maximum value an int variable may have? Question options: System.out.println(MAX_VALUE); System.out.println(integer.MAX_VALUE); System.out.println(Integer.MAX_VALUE); System.out.println(INTEGER.MAX_VALUE);
System.out.println(Integer.MAX_VALUE);
The StringBuilder class's insert method allows you to insert a(n) __________ into the calling object's string. Question options: char array String object primitive type All of these
All of these
The __________ class is the wrapper class for the char data type. Question options: StringBuilder Integer Character String
Character