Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Java Programming Study Set 1
Quiz 7: Characters, Strings and the Stringbuilder
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 61
Essay
Why would you use the append() method? Provide an example.
Question 62
Essay
yourCounty = "Clark" yourCounty.startsWith("Cla") What value will be returned by the startsWith() method? Explain how the startsWith() method deals with case sensitivity.
Question 63
Essay
How can you change the length of a String in a StringBuilder object?
Question 64
Essay
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 .
Question 65
Essay
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.
Question 66
Essay
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 ?
Question 67
Essay
String s and other objects that can't be changed are said to be immutable. What does this mean and how does it relate to values held in memory addresses?
Question 68
Essay
StringBuilder greeting = new StringBuilder("Welcome"); Use the append() method to add the characters "home" to the end of the StringBuilder object created above.
Question 69
Essay
StringBuilder greeting = new StringBuilder("Day 1"); Using the above StringBuilder , create a setCharAt() method that will change the "1" to a "2" in the String "Day 1" . Explain how the setCharAt() method operates.