Exam 8: Text Processing and Wrapper Classes
Exam 1: Introduction to Computers and Java40 Questions
Exam 2: Java Fundamentals40 Questions
Exam 3: A First Look at Classes and Objects40 Questions
Exam 4: Decision Structures42 Questions
Exam 5: Loops and Files40 Questions
Exam 6: A Second Look at Classes and Objects40 Questions
Exam 7: Arrays and the Arraylist Class40 Questions
Exam 8: Text Processing and Wrapper Classes40 Questions
Exam 9: Inheritance40 Questions
Exam 10: Exceptions and Advanced File Io40 Questions
Exam 11: Java-Fx: Gui Programming and Basic Controls40 Questions
Exam 12: Java-Fx: Advanced Controls40 Questions
Exam 13: Java-Fx: Graphics, Effects, and Media40 Questions
Exam 14: Recursion24 Questions
Exam 15: Databases40 Questions
Select questions type
Which of the following import statements is required to use the StringTokenizer class?
Free
(Multiple Choice)
4.9/5
(72)
Correct Answer:
C
What will be displayed after the following code is executed?
StringBuilder strb = new StringBuilder(12);
Strb.append("The cow ");
Strb.append("jumped over the ");
Strb.append("moon.");
System.out.println(strb);
Free
(Multiple Choice)
4.9/5
(77)
Correct Answer:
B
A series of words or other items of data, separated by spaces or other characters, are known as
Free
(Multiple Choice)
4.8/5
(80)
Correct Answer:
B
If a string has more than one character used as a delimiter, you must write a loop to determine the tokens, one for each delimiter character.
(True/False)
4.9/5
(83)
Which of the following import statements is required to use the Character wrapper class?
(Multiple Choice)
4.8/5
(82)
The StringBuilder class's insert method allows you to insert a(n) __________ into the calling object's string.
(Multiple Choice)
4.9/5
(90)
The String class's regionMatches method performs a case-insensitive comparison.
(True/False)
4.7/5
(79)
Which of the following statements converts an int variable named number to a string and stores the value in the String object variable named str?
(Multiple Choice)
4.8/5
(77)
In the following statement, what data type must recField be? str.getChars(5, 10, recField, 0);
(Multiple Choice)
4.8/5
(86)
What will be displayed after the following code is executed?
String str1 = "The quick brown fox jumped over the lazy dog.";
String str2 = str1.substring(20, 26);
System.out.println(str2);
(Multiple Choice)
4.9/5
(86)
When working with the String and StringBuilder classes' getChars method, the character at the start position is included in the substring but the character at the end position is not included.
(True/False)
4.8/5
(76)
What are the tokens in the following statement?
StringTokenizer st = new StringTokenizer("9-14-2018", "-", true);
(Multiple Choice)
4.9/5
(74)
Any ___________ argument passed to the Character class's toLowerCase method or toUpperCase method is returned as it is.
(Multiple Choice)
4.8/5
(80)
The String class's valueOf method accepts a string representation as an argument and returns its equivalent integer value.
(True/False)
4.8/5
(77)
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?
(Multiple Choice)
4.9/5
(73)
Which of the following statements is not true about the following code? StringBuilder strb = new StringBuilder("Total number of parts: ");
Strb.insert(23, 32);
(Multiple Choice)
4.9/5
(68)
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);
(Multiple Choice)
4.8/5
(68)
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));
}
(Multiple Choice)
4.8/5
(85)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)