Exam 7: Characters, Strings and the Stringbuilder

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

A ____ is a class for storing and manipulating changeable data that is composed of multiple characters.

(Multiple Choice)
4.9/5
(36)

The terms "literal string" and "string literal" have different meanings in Java programming.

(True/False)
4.8/5
(33)
Match each term with the correct statement below.
Premises:
Object that can't be changed
Responses:
immutable
parseDouble().
capacity
Correct Answer:
Verified
Premises:
Responses:
Object that can't be changed
immutable
(Matching)
4.8/5
(41)

The String class ____ method evaluates the contents of two String objects to determine if they are equivalent.

(Multiple Choice)
4.9/5
(37)

A literal string is called a(n) ____.

(Multiple Choice)
4.8/5
(32)

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

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

StringBuilder greeting = new StringBuilder("Welcome home "); phrase.insert(13, "Joe"); Using the above code and insert() method, describe how the phrase will appear after the code executes. How does the insert() method work?

(Essay)
4.8/5
(39)
Match each term with the correct statement below.
Premises:
Determines whether a specific character occurs within a String
Responses:
buffer
immutable
insert()
Correct Answer:
Verified
Premises:
Responses:
Determines whether a specific character occurs within a String
buffer
(Matching)
4.9/5
(34)

The methods of the Character class that begin with ____ return a character that has been converted to the stated format.

(Multiple Choice)
4.8/5
(34)
Match each term with the correct statement below.
Premises:
Memory block
Responses:
immutable
substring().
insert()
Correct Answer:
Verified
Premises:
Responses:
Memory block
immutable
(Matching)
4.7/5
(33)

The ____ method requires an integer argument that indicates the position of the character at that position, starting at 0.

(Multiple Choice)
4.8/5
(29)

Why would you use the append() method? Provide an example.

(Essay)
4.9/5
(37)

The StringBuffer class is more efficient than the StringBuilder class because it can execute multiple threads during program execution.

(True/False)
4.9/5
(34)

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 .

(Essay)
4.9/5
(39)

If you try to use an index that is greater than 0 or less than the index of the last position in the StringBuilder object, you cause an error known as an exception and your program terminates.

(True/False)
4.9/5
(38)
Match each term with the correct statement below.
Premises:
Takes a String argument and returns its double value
Responses:
concatenation
setLength()
toLowerCase().
Correct Answer:
Verified
Premises:
Responses:
Takes a String argument and returns its double value
concatenation
(Matching)
4.8/5
(43)

Explain what is needed to declare a String variable and provide an example.

(Essay)
4.9/5
(31)

String s and other objects that can't be changed are known as ____.

(Multiple Choice)
4.8/5
(32)

The Character class ____ from java.lang.Object .

(Multiple Choice)
4.9/5
(38)
Showing 61 - 80 of 82
close modal

Filters

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