Exam 7: Characters, Strings, and the Stringbuilder
Exam 1: Creating Java Programs68 Questions
Exam 2: Using Data74 Questions
Exam 3: Using Methods, Classes, and Objects68 Questions
Exam 4: More Object Concepts67 Questions
Exam 5: Making Decisions70 Questions
Exam 6: Looping72 Questions
Exam 7: Characters, Strings, and the Stringbuilder73 Questions
Exam 8: Arrays74 Questions
Exam 9: Advanced Array Concepts74 Questions
Exam 10: Introduction to Inheritance70 Questions
Exam 11: Advanced Inheritance Concepts70 Questions
Exam 12: Exception Handling65 Questions
Exam 13: File Input and Output74 Questions
Exam 14: Introduction to Swing Components74 Questions
Exam 15: Advanced Gui Topics69 Questions
Exam 16: Graphics74 Questions
Exam 17: Applets, Images, and Sound72 Questions
Select questions type
String oneStr = "Welcome Jim" String twoStr = "Welcome Joe"
Given the lines of code above, which of the following regionMatches() expressions will result in a value of true?
(Multiple Choice)
4.8/5
(64)
Explain what is needed to declare a String variable and provide an example.
(Essay)
4.9/5
(70)
Besides Double and Integer, other wrapper classes such as Float and Long also provide ____ methods that convert Strings to the wrapper types.
(Multiple Choice)
4.9/5
(68)
Match each term with the correct statement below.
-Change the length of a string in a StringBuilder object
(Multiple Choice)
4.8/5
(60)
yourCounty = "perry";
yourCounty.equals("Perry");
yourCounty.equalsIgnoreCase("Perry");
Using the above statements, what value will be returned by the equals() method? What will be the value of the equalsIgnoreCase() method? Explain how the equalsIgnoreCase() method can be useful when users type responses to prompts in programs.
(Essay)
4.9/5
(81)
Match each term with the correct statement below.
-Add characters at a specific location within a StringBuilder object
(Multiple Choice)
5.0/5
(82)
Match each term with the correct statement below.
-A named object of the String class
(Multiple Choice)
4.9/5
(74)
Any string value that is input into a program can be used in arithmetic operations.
(True/False)
4.8/5
(93)
Match each term with the correct statement below.
-Determines whether a specific character occurs within a String
(Multiple Choice)
4.9/5
(81)
How can you use String methods to change the case of a string? Provide an example.
(Essay)
4.7/5
(76)
Methods that return information about an object are called accessor methods.
(True/False)
4.9/5
(85)
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.9/5
(91)
String firstCompare = "Oak Maple Pine"
String secondCompare = "spruce maple elm"
firstCompare.regionMatches(false, 4, secondCompare, 7, 5)
Using the above code, what will be the Boolean value after execution of the regionMatches statement? Explain how the Strings are compared using the regionMatches() method.
(Essay)
4.8/5
(72)
The terms "literal string" and "string literal" are entirely different in Java programming.
(True/False)
4.8/5
(82)
import javax.swing.JOptionPane;
public class Practice
{
public static void main(String[] args)
{
String fullName;
char firstLetter;
____
____
}
}
Accepting a String from a user is common practice. Using the above code, write the statements to accept a String response from a user. Prompt the user with "Enter your name". Then use the charAt() method to extract the first character of the String.
(Short Answer)
4.7/5
(66)
Match each term with the correct statement below.
-A memory block
(Multiple Choice)
4.8/5
(66)
The creators of Java chose ____ characters as the "extra" length for a StringBuilder object.
(Multiple Choice)
4.9/5
(79)
When using the prewritten equals() method, a true or false comparison between two Strings is returned, but you do not know how the code looks behind the scenes.
(True/False)
4.9/5
(77)
Showing 21 - 40 of 73
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)