Exam 9: Text Processing and More About Wrapper Classes

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

What will be displayed after the following code is executed? String str = "abc456"; For (int i = 0; i < str.length(); i++) { Char chr = str.CharAt(i); If (!Character.isLetter(chr)) System.out.print(Character.toUpperCase(chr)); }

(Multiple Choice)
4.9/5
(35)

Which of the following statements converts an int variable named number to a string and stores the value in the String object variable named str?

(Multiple Choice)
4.7/5
(33)

What will be displayed after the following statements are executed? StringBuilder strb = new StringBuilder("We have lived In Chicago, Trenton, and Atlanta."); Strb.replace(17, 24, "Tampa"); System.out.println(strb);

(Multiple Choice)
4.9/5
(33)

You can concatenate String objects by using the __________.

(Multiple Choice)
4.7/5
(37)

The term __________ is commonly used to refer to a string that is part of another string.

(Multiple Choice)
4.7/5
(44)

Which of the following statements converts a String object variable named str to an int and stores the value in the variable x?

(Multiple Choice)
4.8/5
(34)

You cannot assign a value to a wrapper class object.

(True/False)
4.8/5
(36)

The process of breaking a string down into tokens is known as __________.

(Multiple Choice)
4.8/5
(42)

If str is declared as: String str = "ABCDEFGHI"; What will be returned from the following statement? Character.toLowerCase(str.charAt(5))

(Multiple Choice)
4.7/5
(33)

What is the term used for a class that is "wrapped around" a primitive data type and allows you to create objects instead of variables?

(Multiple Choice)
4.8/5
(39)

The String class's regionMatches method performs a case-insensitive comparison.

(True/False)
4.9/5
(31)

A wrapper class is a class that is "wrapped around" a primitive data type and allows you to create objects instead of variables.

(True/False)
4.8/5
(49)

Which of the following statements will print the maximum value an int variable may have?

(Multiple Choice)
4.9/5
(47)

The Character wrapper class provides numerous methods for __________.

(Multiple Choice)
4.8/5
(39)

The term used for the character that separates tokens is __________.

(Multiple Choice)
4.8/5
(37)

What will be the value of position after the following code is executed? int position; String str = "The cow jumped over the moon."; Position = str.indexOf("ov");

(Multiple Choice)
4.9/5
(39)

In the following statement, what data type must recField be? str.getChars(5, 10, recField, 0);

(Multiple Choice)
4.8/5
(35)

The __________ method returns a copy of the calling String object with all leading and trailing whitespace characters deleted.

(Multiple Choice)
4.8/5
(32)

What will be displayed after the following code is executed? String str1 = "The quick brown fox jumped over the lazy dog."; String str2 = str1.substring(20, 26); System.out.println(str2);

(Multiple Choice)
4.9/5
(31)

Which of the following statements will convert the string, str = "285" to an int?

(Multiple Choice)
4.8/5
(48)
Showing 41 - 60 of 62
close modal

Filters

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