text processing

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

A series of words or other items of data, separated by spaces or other characters, is known as a __________. a. string b. token c. delimiter d. caption

b. token

The ________ character appears at the end (the right side) of a string, after the non-space characters. a. leading whitespace b. trailing whitespace c. character return d. line feed

b. trailing whitespace

The __________ method returns a copy of the calling String object with all leading and trailing whitespace characters deleted. a. remove b. trim c. compress d. concat

b. trim

The no-arg constructor for a StringBuilder object gives the object enough storage space to hold __________ characters. a. 0 b. 8 c. 16 d. 32

c. 16

What are the tokens in the following statement? StringTokenizer st = new StringTokenizer("9-14-2018"", "-"", true); a. 9, 14, 2018 b. - c. 9, 14, 2018, - d. None of these

c. 9, 14, 2018, -

The __________ class is the wrapper class for the char data type. a. StringBuilder b. Integer c. Character d. String

c. Character

Which of the following statements will print the maximum value an int variable may have? a. System.out.println(MAX_VALUE); b. System.out.println(integer.MAX_VALUE); c. System.out.println(Integer.MAX_VALUE); d. System.out.println(INTEGER.MAX_VALUE);

c. System.out.println(Integer.MAX_VALUE);

If str is declared as: String str = "ABCDEFGHI"; What will be returned from the following statement? Character.toLowerCase(str.charAt(5)); a. e b. E c. f d. F

c. f

The term __________ is commonly used to refer to a string that is part of another string. a. nested string b. literal c. substring d. delimiter

c. substring

The StringBuilder class's insert method allows you to insert a(n) __________ into the calling object's string. a. char array b. String object c. primitive type d. All of these

d. All of these

Which of the following statements will convert the string str = "285" to an int? a. int x = str; b. int x = Integer.parseInteger(str); c. int x = Integer.integer(str); d. int x = Integer.parseInt(str);

d. int x = Integer.parseInt(str);

The String class's __________ method accepts a value of any primitive data type as its argument and returns a string representation of the value. a. trim b. getChar c. toString d. valueOf

d. valueOf

Which of the following statements will display the maximum value that a double can hold? a. System.out.println(Double.MAX_VALUE); b. System.out.println(Double.MAXIMUM_VALUE); c. System.out.println(Double.MAX_VAL); d. System.out.println(<double>(MAX_VALUE));

a. System.out.println(Double.MAX_VALUE);

Any ___________ argument passed to the Character class's toLowerCase method or toUpperCase method is returned as it is. a. nonletter b. char c. string d. static

a. nonletter

The __________ method of the String class can be used to tokenize a string. a. split b. tokenize c. trim d. length

a. split

The wrapper classes in Java are immutable, which means that once you create an object, you cannot change the object's value. a. true b. false

a. true

You can change the contents of a StringBuilder object, but you cannot change the contents of a String object. a. true b. false

a. true

The term used for the character that separates tokens is __________. a. tokenizer b. delimiter c. whitespace d. separator

b. delimiter

What is the value of str after the following code has been executed? String str; String sourceStr = """Hey diddle"," diddle"," the cat and the fiddle"""; str = sourceStr.substring(12","17); a. diddle b. diddl c. didd d. iddle

b. diddl

The following statement correctly creates a StringBuilder object. StringBuilder str = "Tuna sandwich"; a. true b. false

b. false


Set pelajaran terkait

Maternity and Women's Health Nursing: Women's Health

View Set

BIO 403L Autonomic Nervous System (ANS) Lab

View Set

Chapter 10 Patterns of Inheritance Biology

View Set

Chapter 9 exam - Retirement plans

View Set

toreezy intro to business information systems 7-9

View Set

Chapter 54: sexually transmitted infections

View Set

(Health) 2 - Health Insurance Providers

View Set