Deck 9: Text Processing and More About Wrapper Classes

ملء الشاشة (f)
exit full mode
سؤال
You cannot assign a value to a wrapper class object.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
The term ________ commonly is used to refer to a string that is part of another string.

A) strand
B) substring
C) character fragment
D) nested string
سؤال
You can change the contents of a StringBuilder object, but you cannot change the contents of a String object.
سؤال
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?

A) intrinsic class
B) enclosed object
C) wrapper class
D) transitional object
سؤال
If a non-letter is passed to the toLowerCase or toUpperCase method, it is returned unchanged.
سؤال
The following statement correctly creates a StringBuilder object.
StringBuilder str = "Tuna sandwich";
سؤال
The wrapper classes in Java are immutable, which means that once you create an object, you cannot change the object's value.
سؤال
The ________ character appears at the end (the right side) of a string, after the non-space characters.

A) leading whitespace
B) character return
C) trailing whitespace
D) line feed
سؤال
StringBuilder objects are not immutable.
سؤال
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
سؤال
If you are using characters other than whitespaces as delimiters, you will probably want to trim the string before tokenizing; otherwise, the leading and/or following whitespaces will become part of the first and/or last token.
سؤال
A wrapper class is a class that is "wrapped around" a primitive data type and allows you to create objects instead of variables.
سؤال
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
سؤال
If a string has more than one character used as a delimiter, you must write a loop to determine the tokens, one for each delimiter character.
سؤال
When working with the String and StringBuilder classes' getChars method, the character at the start position is included in the substring but the character at the end position is not included.
سؤال
Most of the String comparison methods are case sensitive.
سؤال
The String class's valueOf method accepts a string representation as an argument and returns its equivalent integer value.
سؤال
If a non-letter argument is passed to the toLowerCase or toUpperCase method, the boolean value false is returned.
سؤال
Trying to extract more tokens than exist from a StringTokenizer object will cause an error.
سؤال
The String class's regionMatches method performs a case-insensitive comparison.
سؤال
Which of the following statements converts a String object variable named str to an int and stores the value in the variable x?

A) int x = Integer.integer(str);
B) int x - str;
C) int x = Integer.parseInteger(str);
D) int x = Integer.parseInt(str);
سؤال
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
سؤال
The process of breaking a string down into tokens is known as __________.

A) tokenizing
B) buffering
C) simplifying
D) parsing
سؤال
You can concatenate String objects by using the __________.

A) concat or trim methods
B) concat method or the + operator
C) concatenate or join methods
D) concatenate method or the + operator
سؤال
The StringBuilder class's insert method allows you to insert a(n) __________ into the calling object's string.

A) char array
B) primitive type
C) String object
D) All of these
سؤال
Each of the numeric wrapper classes has a static ________ method that converts a number to a string.

A) GetString
B) Parse
C) ToString
D) Convert
سؤال
The __________ class is the wrapper class for the char data type.

A) StringBuilder
B) Integer
C) Character
D) String
سؤال
The Character wrapper class provides numerous methods for __________.

A) converting objects to primitive data types
B) testing and converting character data
C) testing and converting numeric literals
D) performing operations with named constants
سؤال
Which of the following import statements is required to use the Character wrapper class?

A) import java.String;
B) import java.lang.Char;
C) import java.Char;
D) No import statement is required
سؤال
The __________ method of the String class can be used to tokenize a string.

A) split
B) tokenize
C) trim
D) length
سؤال
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
سؤال
When using the String class's trim method, a __________ cannot be trimmed.

A) space
B) tab
C) semicolon
D) newline
سؤال
What will be printed after the following code is executed?
String str = "abc456";
Int m = 0;
While ( m < 6 )
{
If (Character.isLetter(str.charAt(m)))
System.out.print(
Character.toUpperCase(str.charAt(m)));
M++;
}

A) abc456
B) ABC456
C) ABC
D) 456
سؤال
The process of converting a wrapper class object to a primitive type is known as __________.

A) simplifying
B) unboxing
C) parsing
D) devaluating
سؤال
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?

A) String str = Integer.toString(number);
B) String str = number.Integer.toString(str);
C) String str = integer(number);
D) String str = integer.toString(number);
سؤال
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
سؤال
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
سؤال
The term used for the character that separates tokens is __________.

A) tokenizer
B) delimiter
C) whitespace
D) separator
سؤال
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((MAX_VALUE));
سؤال
Autoboxing is __________.

A) Java's process of automatically "boxing up" a value inside an object
B) the automatic allocation of array elements
C) the process of assigning a default value to primitive data types
D) the process of identifying tokens in a string
سؤال
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");

A) 14
B) 15
C) 18
D) 17
سؤال
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
سؤال
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
سؤال
In the following statement, what data type must recField be? str.getChars(5, 10, recField, 0);

A) int
B) char[ ]
C) char
D) String
سؤال
What will be displayed after the following code is executed? String str = "RSTUVWXYZ";
System.out.println(str.charAt(5));

A) W
B) X
C) V
D) U
سؤال
In the following code, how many times will the for loop execute?
String str = "1,2,3,4,5,6,7,8,9");
String[ ] tokens = str.split(",");
For (String s : tokens)
System.out.println(s);

A) 1
B) 5
C) 7
D) 9
سؤال
What would be the results of executing the following code?
StringBuilder str = new StringBuilder("Little Jack
Horner ");
Str)append("sat on the ");
Str)append("corner");

A) The program would crash.
B) str would reference "Little Jack Horner ".
C) str would reference "Little Jac Horner sat on the ".
D) str would reference "Little Jack Horner sat on the corner".
سؤال
In the following code, how many times will the for loop execute?
String str = ("Ben and Jerry's ice cream is great.");
String[ ] tokens = str.split(" ");
For (String s : tokens)
System.out.println(s);

A) 1
B) 3
C) 5
D) 7
سؤال
What will be displayed after the following code is executed? boolean matches;
String str1 = "The cow jumped over the moon.";
String str2 = "moon";
Matches = str1.endsWith(str1);
System.out.println(matches);

A) true
B) moon
C) false
D) The cow
سؤال
What will be displayed after the following code is executed? StringBuilder strb = new StringBuilder(12);
Strb.append("The cow ");
Strb.append("jumped over the ");
Strb.append("moon.");
System.out.println(strb);

A) The cow
Jumped over the
Moon.
B) The cow jumped over the moon.
C) The cow jump
D) 12The cow jumped over the moon.
سؤال
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));
}

A) ABC
B) ABC456
C) 456
D) abc456
سؤال
What are the tokens in the following code? String str = "123-456-7890";
String[ ] tokens = str.split("-");

A) 123, 456,7890
B) 123, 456, 7890,-
C) -
D) None of these
سؤال
What are the tokens in the following statement? StringTokenizer st = new StringTokenizer("9-14-2018", "-", true);

A) 9, 14, 2018
B) 9, 14, 2018, -
C) -
D) None 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);
سؤال
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);

A) n fox
B) jumped
C) lazy d
D) x jump
سؤال
Given the following, which of the statements below is not true? str.insert(8, 32);

A) str is a StringBuilder type object.
B) The insert will start at position 32.
C) The starting position for the insert is 8.
D) The literal number 32 will be inserted.
سؤال
What will be the value of matches after the following code is executed? boolean matches;
String[ ] productCodes = {"456HI345", "3456hj"};
Matches = productCodes[0].regionMatches(true, 1,
ProductCodes[1], 2, 3);

A) 56H
B) 56h
C) true
D) false
سؤال
Which of the following statements will convert the string, str = "285.74" to a double?

A) double x = str;
B) double x = Double.parseDouble(str);
C) double x = Double.Double(str);
D) double x = str.Double.parseDouble;
سؤال
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.lastIndexOf("ov", 14);

A) 14
B) 1
C) 0
D) -1
سؤال
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);
سؤال
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);

A) We have lived in Tampa, Trenton, and Atlanta.
B) We have lived in Chicago, Trenton, and Tampa.
C) We have lived in Chicago,Tampaon, and Atlanta.
D) We have lived in Chicago, Tampa, and Atlanta.
سؤال
What will be displayed after the following statements are executed? String str = "red$green&blue#orange";
String[ ] tokens = str.split("[$&#]");
For (String s : tokens)
System.out.print(s + " ");

A) red green blue orange
B) red $ green & blue # orange
C) $ & #
D) red[$&#]green[$&#]blue[$&#]orange
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/62
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 9: Text Processing and More About Wrapper Classes
1
You cannot assign a value to a wrapper class object.
False
2
The term ________ commonly is used to refer to a string that is part of another string.

A) strand
B) substring
C) character fragment
D) nested string
B
3
You can change the contents of a StringBuilder object, but you cannot change the contents of a String object.
True
4
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?

A) intrinsic class
B) enclosed object
C) wrapper class
D) transitional object
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
5
If a non-letter is passed to the toLowerCase or toUpperCase method, it is returned unchanged.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
6
The following statement correctly creates a StringBuilder object.
StringBuilder str = "Tuna sandwich";
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
7
The wrapper classes in Java are immutable, which means that once you create an object, you cannot change the object's value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
8
The ________ character appears at the end (the right side) of a string, after the non-space characters.

A) leading whitespace
B) character return
C) trailing whitespace
D) line feed
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
9
StringBuilder objects are not immutable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
10
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
11
If you are using characters other than whitespaces as delimiters, you will probably want to trim the string before tokenizing; otherwise, the leading and/or following whitespaces will become part of the first and/or last token.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
12
A wrapper class is a class that is "wrapped around" a primitive data type and allows you to create objects instead of variables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
13
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
14
If a string has more than one character used as a delimiter, you must write a loop to determine the tokens, one for each delimiter character.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
15
When working with the String and StringBuilder classes' getChars method, the character at the start position is included in the substring but the character at the end position is not included.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
16
Most of the String comparison methods are case sensitive.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
17
The String class's valueOf method accepts a string representation as an argument and returns its equivalent integer value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
18
If a non-letter argument is passed to the toLowerCase or toUpperCase method, the boolean value false is returned.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
19
Trying to extract more tokens than exist from a StringTokenizer object will cause an error.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
20
The String class's regionMatches method performs a case-insensitive comparison.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
21
Which of the following statements converts a String object variable named str to an int and stores the value in the variable x?

A) int x = Integer.integer(str);
B) int x - str;
C) int x = Integer.parseInteger(str);
D) int x = Integer.parseInt(str);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
22
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
23
The process of breaking a string down into tokens is known as __________.

A) tokenizing
B) buffering
C) simplifying
D) parsing
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
24
You can concatenate String objects by using the __________.

A) concat or trim methods
B) concat method or the + operator
C) concatenate or join methods
D) concatenate method or the + operator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
25
The StringBuilder class's insert method allows you to insert a(n) __________ into the calling object's string.

A) char array
B) primitive type
C) String object
D) All of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
26
Each of the numeric wrapper classes has a static ________ method that converts a number to a string.

A) GetString
B) Parse
C) ToString
D) Convert
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
27
The __________ class is the wrapper class for the char data type.

A) StringBuilder
B) Integer
C) Character
D) String
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
28
The Character wrapper class provides numerous methods for __________.

A) converting objects to primitive data types
B) testing and converting character data
C) testing and converting numeric literals
D) performing operations with named constants
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
29
Which of the following import statements is required to use the Character wrapper class?

A) import java.String;
B) import java.lang.Char;
C) import java.Char;
D) No import statement is required
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
30
The __________ method of the String class can be used to tokenize a string.

A) split
B) tokenize
C) trim
D) length
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
31
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
32
When using the String class's trim method, a __________ cannot be trimmed.

A) space
B) tab
C) semicolon
D) newline
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
33
What will be printed after the following code is executed?
String str = "abc456";
Int m = 0;
While ( m < 6 )
{
If (Character.isLetter(str.charAt(m)))
System.out.print(
Character.toUpperCase(str.charAt(m)));
M++;
}

A) abc456
B) ABC456
C) ABC
D) 456
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
34
The process of converting a wrapper class object to a primitive type is known as __________.

A) simplifying
B) unboxing
C) parsing
D) devaluating
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
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?

A) String str = Integer.toString(number);
B) String str = number.Integer.toString(str);
C) String str = integer(number);
D) String str = integer.toString(number);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
36
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
37
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
38
The term used for the character that separates tokens is __________.

A) tokenizer
B) delimiter
C) whitespace
D) separator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
39
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((MAX_VALUE));
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
40
Autoboxing is __________.

A) Java's process of automatically "boxing up" a value inside an object
B) the automatic allocation of array elements
C) the process of assigning a default value to primitive data types
D) the process of identifying tokens in a string
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
41
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");

A) 14
B) 15
C) 18
D) 17
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
42
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
43
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
44
In the following statement, what data type must recField be? str.getChars(5, 10, recField, 0);

A) int
B) char[ ]
C) char
D) String
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
45
What will be displayed after the following code is executed? String str = "RSTUVWXYZ";
System.out.println(str.charAt(5));

A) W
B) X
C) V
D) U
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
46
In the following code, how many times will the for loop execute?
String str = "1,2,3,4,5,6,7,8,9");
String[ ] tokens = str.split(",");
For (String s : tokens)
System.out.println(s);

A) 1
B) 5
C) 7
D) 9
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
47
What would be the results of executing the following code?
StringBuilder str = new StringBuilder("Little Jack
Horner ");
Str)append("sat on the ");
Str)append("corner");

A) The program would crash.
B) str would reference "Little Jack Horner ".
C) str would reference "Little Jac Horner sat on the ".
D) str would reference "Little Jack Horner sat on the corner".
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
48
In the following code, how many times will the for loop execute?
String str = ("Ben and Jerry's ice cream is great.");
String[ ] tokens = str.split(" ");
For (String s : tokens)
System.out.println(s);

A) 1
B) 3
C) 5
D) 7
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
49
What will be displayed after the following code is executed? boolean matches;
String str1 = "The cow jumped over the moon.";
String str2 = "moon";
Matches = str1.endsWith(str1);
System.out.println(matches);

A) true
B) moon
C) false
D) The cow
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
50
What will be displayed after the following code is executed? StringBuilder strb = new StringBuilder(12);
Strb.append("The cow ");
Strb.append("jumped over the ");
Strb.append("moon.");
System.out.println(strb);

A) The cow
Jumped over the
Moon.
B) The cow jumped over the moon.
C) The cow jump
D) 12The cow jumped over the moon.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
51
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));
}

A) ABC
B) ABC456
C) 456
D) abc456
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
52
What are the tokens in the following code? String str = "123-456-7890";
String[ ] tokens = str.split("-");

A) 123, 456,7890
B) 123, 456, 7890,-
C) -
D) None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
53
What are the tokens in the following statement? StringTokenizer st = new StringTokenizer("9-14-2018", "-", true);

A) 9, 14, 2018
B) 9, 14, 2018, -
C) -
D) None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
54
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);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
55
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);

A) n fox
B) jumped
C) lazy d
D) x jump
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
56
Given the following, which of the statements below is not true? str.insert(8, 32);

A) str is a StringBuilder type object.
B) The insert will start at position 32.
C) The starting position for the insert is 8.
D) The literal number 32 will be inserted.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
57
What will be the value of matches after the following code is executed? boolean matches;
String[ ] productCodes = {"456HI345", "3456hj"};
Matches = productCodes[0].regionMatches(true, 1,
ProductCodes[1], 2, 3);

A) 56H
B) 56h
C) true
D) false
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
58
Which of the following statements will convert the string, str = "285.74" to a double?

A) double x = str;
B) double x = Double.parseDouble(str);
C) double x = Double.Double(str);
D) double x = str.Double.parseDouble;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
59
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.lastIndexOf("ov", 14);

A) 14
B) 1
C) 0
D) -1
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
60
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);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
61
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);

A) We have lived in Tampa, Trenton, and Atlanta.
B) We have lived in Chicago, Trenton, and Tampa.
C) We have lived in Chicago,Tampaon, and Atlanta.
D) We have lived in Chicago, Tampa, and Atlanta.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
62
What will be displayed after the following statements are executed? String str = "red$green&blue#orange";
String[ ] tokens = str.split("[$&#]");
For (String s : tokens)
System.out.print(s + " ");

A) red green blue orange
B) red $ green & blue # orange
C) $ & #
D) red[$&#]green[$&#]blue[$&#]orange
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 62 في هذه المجموعة.