Académique Documents
Professionnel Documents
Culture Documents
(1) Points
int
String
intVal(*)
strVal(*)
Hello
Correct
(1) Points
True (*)
False
Correct
(1) Points
a (*)
Welcome
int
2
Correct
(1) Points
String x = Java;
String x= “Java”; (*)
String “x” = Java;
String “x” = “Java”;
Correct
(1) Points
Hello
World
Hello World
Hello
World (*)
Correct
Page 1 of 3 Next
(1) Points
String firstName = “Alex”;(*)
int averageDollarAmount = 19.95;
double checkingAmount = 1500;(*)
boolean age = 20;
Correct
(1) Points
int break=10;(*)
int age=20;
double double=10;(*)
double salary = 20000.34;
int abc = 10;
Correct
(1) Points
True (*)
False
Correct
(1) Points
–27 to 27–1 (*)
–215 to 215–1
–231 to 231–1
–263 to 263–1
Correct
10. Which of the following data types is the largest?
Mark for Review
(1) Points
byte
short
int
long (*)
Correct
Previous Page 2 of 3 Next
(1) Points
Value of x is 0
Value of y is 1
Value of x is 100
Value of y is 1
Value of x is 100
Value of y is 1
Value of x is 100
Value of y is 101 (*)
Correct
(1) Points
2
4
6
7
8 (*)
Correct
(1) Points
+(*)
–(*)
#
@
Correct
(1) Points
const
final (*)
static
break
Correct
15. Which data type is most commonly used to represent numeric data?
Mark for Review
(1) Points
int (*)
float
String
short
Correct
Previous Page 3 of 3
Test: JFo Section 3 Quiz 2 - L3-L5
Review your answers, feedback, and question scores below. An asterisk
(*) indicates a correct answer.
(1) Points
Underscores do not affect the value of the variable.(*)
Underscores change the value of the number.
Underscores help make large numbers more readable.(*)
Underscores help the compiler interpret large numbers.
Correct
2. 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.5
21
20 (*)
25
Correct
(1) Points
A default size is allocated.
The size of the largest data type used in the expression. (*)
The size of the smallest data type used in the expression.
The size of the any data type used in the expression.
Correct
(1) Points
int longToInt = 20L;
int longToInt = int 20L;
int longToInt = (int)20L; (*)
int longToInt = 20L(int);
Correct
(1) Points
Type casting retains the size of the value or the original data type.
Type casting changes the type of the value stored.(*)
Type casting lowers the range of possible values.(*)
Type casting cannot be performed on equations.
Correct
Page 1 of 3 Next
(1) Points
int intVar1 = "100";
int intVar1 = Integer.parseInt("One Hundred");
int intVar1 = Integer.parseInt("100"); (*)
nt intVar1 = (int)"100";
Correct
(1) Points
True (*)
False
Correct
8. These two code fragments perform the same task.
// Fragment 1
String inputString = JOptionPane.showInputDialog("??");
int input = Integer.parseInt(inputString);
input++;
// Fragment 2
int input = Integer.parseInt(JOptionPane.showInputDialog("??")) + 1;
Mark for Review
(1) Points
True (*)
False
Correct
(1) Points
True (*)
False
Correct
(1) Points
True (*)
False
Correct
Previous Page 2 of 3 Next
(1) Points
True (*)
False
Correct
(1) Points
Hello World
“Hello World 2016”
Hello World 2016 ! (*)
“Hello” “World” “2016” “!”
Correct
(1) Points
True
False (*)
Correct
(1) Points
message
Hello World (*)
String message
String message = ”Hello World”;
Correct
(1) Points
True (*)
False
Correct
Previous Page 3 of 3