1. If you have the following program code: int number;
SYSTEM.OUT.PRINTLN (number);
What is the correct description?
A, the implementation of the display 0
B. Display random numbers at execution time
C, error occurred during execution
D, compile failed
2. If you have the following program code:
System.out.println (10/3);
What is the correct description?
A, the implementation of the display 3
B, the implementation of the show 3.33333 ...
C, error occurred during execution
D, compile failed
3. If you have the following program code: float radius=88.2;
Double area= 2 * 3.14 * radius * RADIUS;
System.out.println (area);
What is the correct description?
A, the implementation of the display 48853.6272
B. Display at Execution 48853
C, error occurred during execution
D, compile failed
4. If you have the following program code:
byte a = 100;
byte B = 200;
byte C = (byte) (A + B);
System.out.println (c);
What is the correct description?
A, the implementation of the display 300
B. Display at Execution 127
C, error occurred during execution
D, compile failed
5. If you have the following program code:
SYSTEM.OUT.PRINTLN (integer.max_value + 1 = = Integer.min_value);
What is the correct description?
A. Display true at execution time
B, display false on execution
C, error occurred during execution
D, compile failed
6. If you have the following program code:
System.out.println (-integer.max_value = = Integer.min_value);
What is the correct description?
A. Display true at execution time
B, display false on execution
C, error occurred during execution
D, compile failed
7. If you have the following program code:
int i = 10;
int number = i++;
Number =----I.;
What is the correct description?
A, after the execution number is 10,i 10
B, after the execution number is 10,i 11
C, after the execution number of 11,i is 10
D, after the execution number of 11,i is 11
Note: + + VS---after the variable is used in the operator, does not work.
8. If you have the following program code:
int i = 10;
int number = ++i;
Number = ++i;
What is the correct description?
A, after the execution number is 11,i 11
B, after the execution number is 11,i 12
C, after the execution number of 12,i is 11
D, after the execution number is 12,i
Note: While + + and--used in front of variables, it works because of the order in which the JVM executes.
9. If you have the following program code:
for (int i = 1; i < i++) {
if (i = = 5) {
Continue
}
System.out.printf ("i =%d%n", i);
}
What is the correct description?
A, display i = 1 to 4, and 6 to 9
B, display i = 1 to 9
C, display i = 1 to 4
D, display i = 6 to 9
Note: The role of continue is to jump out of this cycle and continue to the next round of circulation.
10. If you have the following program code:
for (int number = 0; number = = 5; number = (int) (Math.random () * 10)) {
SYSTEM.OUT.PRINTLN (number);
}
What is the correct description?
A, the implementation of the display number will never stop
B, the execution of the display number 0 after the stop
C, the execution of the display number 5 after the stop
D, show numbers on execution until number is 5 stop
Java JDK7 Study notes after class exercises 3