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 Structures40 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 I/O40 Questions
Exam 11: GUI Applications–Part 140 Questions
Exam 12: GUI Applications–Part 240 Questions
Exam 13: Applets and More40 Questions
Exam 14: Creating GUI Applications with JavaFX40 Questions
Exam 15: Recursion20 Questions
Exam 16: Databases40 Questions
Select questions type
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);
Free
(Multiple Choice)
4.9/5
(33)
Correct Answer:
D
Most of the String comparison methods are case sensitive.
Free
(True/False)
4.9/5
(42)
Correct Answer:
True
A wrapper class is a class that is "wrapped around" a primitive data type and allows you to create objects instead of variables.
Free
(True/False)
4.7/5
(46)
Correct Answer:
True
If a string has more than one character used as a delimiter, we must write a loop to determine the tokens, one for each delimiter character.
(True/False)
4.9/5
(36)
Which of the following statements converts a String object variable named str to an int and stores the value in the variable x?
(Multiple Choice)
4.8/5
(37)
Which of the following statements converts a double variable named tax to a string and stores the value in the String object variable named str?
(Multiple Choice)
4.8/5
(40)
What will be displayed after the following code is executed?
String str = "RSTUVWXYZ";
System.out.println(str.charAt(5));
(Multiple Choice)
4.7/5
(42)
Which of the following import statements is required to use the Character wrapper class?
(Multiple Choice)
4.7/5
(37)
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.9/5
(41)
Trying to extract more tokens than exist from a StringTokenizer object will cause an error.
(True/False)
4.8/5
(44)
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");
(Multiple Choice)
4.8/5
(30)
In the following statement, what data type must recField be?
Str)getChars(5, 10, recField, 0);
(Multiple Choice)
4.9/5
(35)
What will be displayed after the following code has been 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
(36)
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
(39)
Which of the following 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.8/5
(38)
The String class's regionMatches method performs a case-insensitive comparison.
(True/False)
4.8/5
(35)
The ________ class is the wrapper class for the char data type.
(Multiple Choice)
4.9/5
(43)
When working with the String and StringBuilder class's 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.9/5
(32)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)