Which of the following expressions will be evaluated using floating-point arithmetic?
Select the three correct answers.
2.0 * 3.0
2 * 3
2/3 + 5/7
2.4 + 1.6
0x10 * 1L * 300.0
What is the value of the expression (1 / 2 + 3 / 2 + 0.1) ?
Select the one correct answer.
1
1.1
1.6
2
2.1
What will be the result of attempting to compile and run the following program?
public class Integers { public static void main(String[] args) { System.out.println(0x10 + 10 + 010); } }
The program will not compile. The compiler will complain about the expression 0x10 + 10 + 010 .
When run, the program will print 28 .
When run, the program will print 30 .
When run, the program will print 34 .
When run, the program will print 36 .
When run, the program will print 101010 .
Which of the following expressions are valid?
(- 1 -)
(+ + 1)
(+-+-+-1)
(--1)
(1 * * 1)
(- -1)
What is the value of evaluating the following expression ( - -1-3 * 10 / 5-1 )?
“8
“6
7
8
10
None of the above.
Which of these assignments are valid?
Select the four correct answers.
short s = 12;
long l = 012;
int other = (int) true;
float f = -123;
double d = 0x12345678;