Exam 7: Characters, Strings and the Stringbuilder

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags
Match each term with the correct statement below.
Premises:
Add characters at a specific location within a StringBuilder object
Responses:
buffer
immutable
concatenation
Correct Answer:
Verified
Premises:
Responses:
Add characters at a specific location within a StringBuilder object
buffer
(Matching)
4.8/5
(41)

In a compareTo() method, programmers often do not need specific return values but want to determine if a value is positive or negative.

(True/False)
4.9/5
(39)

A(n) ____ is a variable that holds a memory address.

(Multiple Choice)
4.7/5
(37)
Match each term with the correct statement below.
Premises:
Returns the lowercase equivalent of the argument
Responses:
indexOf()
toLowerCase().
concatenation
Correct Answer:
Verified
Premises:
Responses:
Returns the lowercase equivalent of the argument
indexOf()
(Matching)
4.8/5
(37)

System.out.println("Your name is " + yourName); The above statement is an example of ____, which is used to join String s.

(Multiple Choice)
4.8/5
(40)
Match each term with the correct statement below.
Premises:
An unnamed object
Responses:
concatenation
capacity
String variable.
Correct Answer:
Verified
Premises:
Responses:
An unnamed object
concatenation
(Matching)
4.8/5
(28)

Which of the following correctly declares and initializes a String object?

(Multiple Choice)
4.7/5
(37)

The ____ method returns the length of a String .

(Multiple Choice)
4.9/5
(33)

A literal string is a(n) ____ object.

(Multiple Choice)
4.8/5
(33)

String aName = "Michael" Using the above statement, write the length() method that will return the length of the aName String . What value will the length() method return when executed?

(Essay)
4.9/5
(32)

How can you change the length of a String in a StringBuilder object?

(Essay)
4.8/5
(40)
Match each term with the correct statement below.
Premises:
A named object of the String class
Responses:
anonymous object
concatenation
append().
Correct Answer:
Verified
Premises:
Responses:
A named object of the String class
anonymous object
(Matching)
4.9/5
(37)

When working with String s, it is necessary to explicitly set a String to null .

(True/False)
4.9/5
(38)
Match each term with the correct statement below.
Premises:
Add characters to the end of a StringBuilder object
Responses:
insert()
anonymous object
toLowerCase().
Correct Answer:
Verified
Premises:
Responses:
Add characters to the end of a StringBuilder object
insert()
(Matching)
4.8/5
(35)

The ____ method converts any object to a String .

(Multiple Choice)
4.9/5
(39)

Describe how a programmer would use the two types of Character class methods (those that begin with "is" and those that begin with "to") for testing the values of characters.

(Essay)
4.9/5
(36)

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.7/5
(44)

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.8/5
(39)

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
(32)

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.9/5
(36)
Showing 21 - 40 of 82
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)