Exam 7: Characters, Strings, and the Stringbuilder

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

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

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

The ____ method allows you to replace all occurrences of some character within a String.

(Multiple Choice)
4.8/5
(42)

The ____ method takes a String argument and returns its double value.

(Multiple Choice)
4.9/5
(43)

When the String class ____ method is used to compare two Strings, it provides additional information to the user in the form of an integer value.

(Multiple Choice)
4.8/5
(42)

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

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

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

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

(Multiple Choice)
4.8/5
(42)

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

(Multiple Choice)
4.9/5
(43)

When you declare a variable of a basic, primitive type, such as int x = 10;, the memory address where x is located holds the ____.

(Multiple Choice)
4.9/5
(34)

If you try to use an index that is less 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.8/5
(33)

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

Match each term with the correct statement below. -Takes a String argument and returns its double value

(Multiple Choice)
4.8/5
(40)

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

The ____ is an attribute of the StringBuilder class that identifies the number of characters in the String contained in the StringBuilder.

(Multiple Choice)
4.8/5
(37)

The ____ method converts any object to a String.

(Multiple Choice)
4.8/5
(41)

A String variable name is not a simple data type.

(True/False)
4.7/5
(36)

The ____ method returns the length of a String.

(Multiple Choice)
4.9/5
(36)

String example1 = ""; String example2 = null; String example3; There is an important difference between empty Strings and null Strings. Explain the differences and why it is important when making String comparisons.

(Essay)
4.8/5
(41)
Showing 41 - 60 of 73
close modal

Filters

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