1. | Given the declarations boolean b; short x1 = 100, x2 = 200, x3 = 300; Which of the following statements are evaluated to true? (A) b = x1 * 2 == x2; (B) b = x1 + x2 != 3 * x1; (C) b = (x3 - 2*x2<0) || ((x3 = 400)<2**x2); (D) b = (x3 - 2*x2>0) || ((x3 = 400) 2*x2); |
| |
Hint
Half-n-half Clue
| |
| |
2. | Given the declarations int x , m = 2000; short y; byte b1 = -40, b2; long n; Which of the following assignment statements will evaluate correctly? (A) x = m * b1; (B) y = m * b1; (C) n = m * 3L; (D) x = m * 3L; |
| | Half-n-half Clue
| |
| |
3. | (1 | 4) + (4 & 2) = ? (in base ten) |
| | Half-n-half Clue
| |
| |
4. | Of the following functions from the class java.lang.Math, select those that produce a value of 25, when a = 25.7. |
| | Half-n-half Clue
| |
| |
5. | 15 & 29 = ? |
| | Half-n-half Clue
| |
| |
6. | Consider the following code: int x, y, z; y = 1; z = 5; x = 0 - (++y) + z++; After execution of this, what will be the values of x, y and z? |
| | Half-n-half Clue
| |
| |
7. | The type long can be used to store values in the following range: |
| | Half-n-half Clue
| |
| |