Quiz3 2
Quiz3 2
True (*)
False
Correct Correct
True
False (*)
Correct Correct
True (*)
False
Correct Correct
True (*)
False
Correct Correct
String message
message
Correct Correct
6. The print() method prints to the console and automatically creates a line.
Mark for Review
(1) Points
True
False (*)
nt intVar1 = (int)"100";
Correct Correct
8. Which two statements are true about type casting? Mark for
Review
(1) Points
Type casting retains the size of the value or the original data type.
Correct Correct
10. Automatic promotion from smaller data type to a larger data type
is not allowed in Java. Mark for Review
(1) Points
True
False (*)
Correct Correct
11. A double with the value of 20.5 is cast to an int. What is the value of the
int? Mark for Review
(1) Points
20 (*)
20.5
25
21
Correct Correct
13. The Scanner class accepts input in which form? Mark for Review
(1) Points
Callables
Integer
Future
Tokens (*)
Incorrect Incorrect. Refer to Section 3 Lesson 5.
True (*)
False
Correct Correct
15. The Scanner class considers space as the default delimiter while
reading the input. Mark for Review
(1) Points
True (*)
False
1. A short data type can be promoted to which of the following types? Mark
for Review
(1) Points
double (*)
boolean
byte
long (*)
int (*)
Correct Correct
True (*)
False
NumberFormatException (*)
ArithmeticException
NullPointerException
ValueNotFoundException
Correct Correct
5. Which two statements are true about type casting? Mark for
Review
(1) Points
Type casting retains the size of the value or the original data type.
Correct Correct
6. Which is a valid way to parse a String as an int? Mark for Review
(1) Points
nt intVar1 = (int)"100";
Correct Correct
True (*)
False
Correct Correct
False
Correct Correct
9. The Scanner class accepts input in which form? Mark for Review
(1) Points
Callables
Tokens (*)
Integer
Future
Correct Correct
10. Which is the correct declaration for a char data type? Mark
for Review
(1) Points
Correct Correct
11. In Java, char is a primitive data type, while String is an object data type.
Mark for Review
(1) Points
True (*)
False
Correct Correct
Hello World
Correct Correct
13. Char data types cannot handle multiple characters. Mark for
Review
(1) Points
True (*)
False
Correct Correct
message
Correct Correct
15. Which two statements are true about String concatenation. Mark
for Review
(1) Points
String concatenation can be done with String variables and String Literals.
(*)
String concatenation cannot be done with more than two String Literals.
Correct Correct