Exam Concept part 1
-15 % -4 is ________.
-3
-5 % 5 is ________.
0
5 % 1 is ________.
0
5 % 5 is ________.
0
________ are valid Java identifiers.
1) $Java 2) _RE4
You can assign the value in ________ to an int variable.
1) 'x' 2) 93
5 % 3 is ________.
2
Which of the following are not valid assignment statements?
55 = x;
parseDouble is a method in the ________ class.
Double
If you attempt to add an int, a byte, a long, and a float, the result will be a ________ value.
double
You can always assign a value of long type to a variable of int type without loss of precision.
false
You can define a constant twice in a block.
false
You can define a variable twice in a block.
false
The keyword ________ must be used to declare a constant.
final
To declare a constant PI, you write ________.
final double PI = 3.14159;
Which of the following assignment statements is illegal?
float f = 34.0;
A Java statement ends with a ________.
semicolon (;)
A constant can be defined using using the final keyword.
true
The value of a variable can be changed.
true
You can cast a character value to an int, or an int to char.
true
To assign a double variable d to an int variable x, you write ________.
x = (int)d;