Exam 7: Characters Strings and the Stringbuilder
Exam 1: Creating Java Programs61 Questions
Exam 2: Using Data67 Questions
Exam 3: Using Methods Classes and Objects66 Questions
Exam 4: More Object Concepts66 Questions
Exam 5: Making Decisions66 Questions
Exam 6: Looping66 Questions
Exam 7: Characters Strings and the Stringbuilder68 Questions
Exam 8: Arrays66 Questions
Exam 9: Advanced Array Concepts66 Questions
Exam 10: Introduction to Inheritance66 Questions
Exam 11: Advanced Inheritance Concepts66 Questions
Exam 12: Exception Handling66 Questions
Exam 13: File Input and Output66 Questions
Exam 14: Introduction to Swing Components66 Questions
Exam 15: Advanced Gui Topics66 Questions
Exam 16: Graphics66 Questions
Select questions type
StringBuilder greeting = new StringBuilder("Hello, John");
char initial = greeting.charAt(7);
Using the above code and the charAt() method, what value will be assigned to the variable initial ?
(Essay)
4.9/5
(91)
String greeting = "Welcome Home";
Using the above String , create the String method to convert the greeting String to all uppercase. Likewise, create the String method to convert the greeting String to all lowercase.
(Essay)
4.8/5
(78)
String firstString = "Oak Maple Pine"
String secondString = "spruce Maple elm"
firstCompare.regionMatches(4, secondString, 7, 5)
Using the above code, what will be the Boolean value after execution of the regionMatches statement? Explain how the String s are compared using the regionMatches() method.
(Essay)
4.9/5
(88)
yourCounty = "Clark"
yourCounty.startsWith("Cla")
What value will be returned by the startsWith() method? Explain how the startsWith() method deals with case sensitivity.
(Essay)
4.8/5
(89)
String greeting = "Welcome back";
Using the above statement, write the length() method that will return the length of the greeting String . Store the length in an integer named greetingLength .
(Short Answer)
5.0/5
(81)
The ____________________ method and the startsWith() method each take a String argument and return true or false if a String object does or does not end or start with the specified argument, respectively.
(Short Answer)
4.8/5
(69)
The String class ____ method evaluates the contents of two String objects to determine if they are equivalent.
(Multiple Choice)
4.9/5
(64)
myCounty = "Clark Jackson Scioto"
myCounty.charAt(6)
Using the above code, what will be the value of the charAt() method once the code executes? Explain how the charAt() method operates.
(Essay)
4.9/5
(74)
To alter just one character in a StringBuilder , you can use the ____ method, which allows you to change a character at a specified position within a StringBuilder object.
(Multiple Choice)
4.9/5
(80)
How is the String class equalsIgnoreCase() method like the equals() method and how would you use it? Give an example.
(Essay)
4.8/5
(75)
String s and other objects that can't be changed are known as ____.
(Multiple Choice)
4.9/5
(99)
When you compare String s with the == operator, you are comparing their values, not their memory addresses.
(True/False)
4.8/5
(75)
Match each term with the correct statement below.
Correct Answer:
Premises:
Responses:
(Matching)
4.9/5
(73)
System.out.println("Your name is " + yourName); The above statement is an example of ____, which is used to join String s.
(Multiple Choice)
4.9/5
(82)
The terms "literal string" and "string literal" are entirely different in Java programming.
(True/False)
4.9/5
(80)
The methods of the Character class that begin with ____ return a character that has been converted to the stated format.
(Multiple Choice)
4.9/5
(82)
How can you use String methods to change the case of a string? Provide an example.
(Essay)
4.8/5
(79)
Showing 41 - 60 of 68
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)