Which of the following are valid Java identifiers?

IdentifierValid?
A __Q1A
88 __Q1B
abc __Q1C
_abc __Q1D
$$ __Q1E
ab c __Q1F
1Z __Q1G
lookupinthesky __Q1H
thing_one __Q1I
thing-one __Q1J

Select the correct type of the literal in the left column.

LiteralType
0L __Q2A
100000 __Q2B
"0L" __Q2C
'A' __Q2D
"" __Q2E
3.14D __Q2F
3.14 __Q2G
3.14f __Q2H
true __Q2I
-1 __Q2J

Drag the types from the left to the right and arrange them in promotion order, where types higher in the list are promoted to types lower in the list.


byte
short
int
long
float
double
String

Evaluate the expressions in the first column. Choose the value to which each evaluates from the second column.

ExpressionValue
5 > 5 __Q4A
5 >= 5 __Q4B
0 < -1 __Q4C
2 + 3 * 4 == 20 __Q4D
true == !false __Q4E
(7 < 9) || (7 > 9) __Q4F
(7 < 9) && (7 > 9) __Q4G
(0 > 1) || (1 > 2) __Q4H
(true || false) || (false && true) __Q4I
!!true __Q4J

Consider each expression on the left. Choose from the dropdowns on the right the the value and type that results from evaluating each expression.

Expression Value Type
1 + 1.0 __Q5AV__Q5AT
2 + 2 * 1.0 __Q5BV__Q5BT
2 * 2 + 1 __Q5CV__Q5CT
3 / 2 + 1 __Q5DV__Q5DT
3 + 2 / 1 __Q5EV__Q5ET
30 / 12 __Q5FV__Q5FT
30 % 12 __Q5GV__Q5GT