August 2003
Intermediate to advanced
672 pages
16h 23m
English
Review Questions |
| 3.20 |
What would be printed during execution of the following program?
public class MyClass {
public static void main(String[] args) {
test(1<<32, "1<<32");
test(1<<31, "1<<31");
test(1<<30, "1<<30");
test(1, "1" );
test(0, "0" );
test(-1, "-1" );
}
public static void test(int i, String exp) {
if ((i >> 1) != (i >>> 1)) System.out.println(exp);
}
}
Select the two correct answers.
|
| 3.21 |
Which of the following are not operators in Java?
Select the two correct answers.
|
| 3.22 | Given a variable x of type int (which may contain a negative value), which are correct ways of doubling the value ... |
Read now
Unlock full access