Exam 9: Text Processing and More About Wrapper Classes
Exam 1: Introduction to Computers and Java51 Questions
Exam 2: Java Fundamentals61 Questions
Exam 3: Decision Structures64 Questions
Exam 4: Loops and Files57 Questions
Exam 5: Methods60 Questions
Exam 6: A First Look at Classes58 Questions
Exam 7: Arrays and the Arraylist Class64 Questions
Exam 8: A Second Look at Classes and Objects50 Questions
Exam 9: Text Processing and More About Wrapper Classes60 Questions
Exam 10: Inheritance70 Questions
Exam 11: Exceptions and Advanced File IO56 Questions
Exam 12: A First Look at GUI Applications60 Questions
Exam 13: Advanced GUI Applications58 Questions
Exam 14: Applets and More54 Questions
Exam 15: Creating GUI Applications With Javafx and Scene Builder40 Questions
Exam 16: Recursion42 Questions
Exam 17: Databases48 Questions
Select questions type
If more than one character is used as a delimiter, we must write a loop to determine the tokens, one for each delimiter character.
(True/False)
4.9/5
(32)
To convert the string, str = "285" to an int, use the following statement:
(Multiple Choice)
4.9/5
(31)
Which of the following statements will print the maximum value a double variable may have?
(Multiple Choice)
4.8/5
(34)
What will be the tokens given the following statements?
String str = ("January 1, 2016");
String[] tokens = str.split(" ");
(Multiple Choice)
4.8/5
(33)
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++;
}
(Multiple Choice)
4.8/5
(39)
For the following code, how many times would the for loop execute?
String str = "1,2,3,4,5,6,7,8,9");
String[] tokens = str.split(",");
For (String s : tokens)
System.out.println(s);
(Multiple Choice)
5.0/5
(35)
If you are using characters other than whitespaces as delimiters, you will probably want to trim the string before tokenizing; otherwise, the leading and/or following whitespaces will become part of the first and/or last token.
(True/False)
4.8/5
(33)
Which of the following methods of the String class can be used to tokenize a string?
(Multiple Choice)
4.8/5
(49)
If a non-letter argument is passed to the toLowerCase or toUpperCase method, the boolean value False is returned.
(True/False)
4.8/5
(31)
You can change the contents of a StringBuilder object, but you cannot change the contents of a String object.
(True/False)
4.8/5
(29)
To convert the int variable, number to a string, use the following statement:
(Multiple Choice)
4.9/5
(40)
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.lastIndexOf("ov", 14);
(Multiple Choice)
4.8/5
(31)
When using the String class's trim method, which of the following cannot be trimmed?
(Multiple Choice)
4.8/5
(32)
Use the following import statement when using the Character wrapper class:
(Multiple Choice)
5.0/5
(41)
The String class's valueOf() method accepts a value of any primitive data type as an argument and returns a string representation of the value.
(True/False)
4.7/5
(35)
For the following code, how many times would the for loop execute?
String str = ("Ben and Jerry's ice cream is great.");
String[] tokens = str.split(" ");
For (String s : tokens)
System.out.println(s);
(Multiple Choice)
4.7/5
(35)
Showing 21 - 40 of 60
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)