Facts about 1z0 808 dumps
The article at Testaimer.com going over http://www.testaimer.com/1z0-808-test is very comprehensive.
Q31. Given:
What is the result?
A. 400 200
B. 200 200
C. 400 400
D. Compilation fails.
Answer: A
Q32. Given:
What is the result?
A. 6 7 8
B. 7 8 9
C. 0 1 2
D. 6 8 10
E. Compilation fails
Answer: A
Q33. Given:
What is the result?
A. 10:20
B. 0:20
C. Compilation fails at line n1
D. Compilation fails at line n2
Answer: D
Q34. Given the code fragment:
System.out.println(2 + 4 * 9 - 3); //Line 21
System.out.println((2 + 4) * 9 - 3); // Line 22
System.out.println(2 + (4 * 9) - 3); // Line 23
System.out.println(2 + 4 * (9 - 3)); // Line 24
System.out.println((2 + 4 * 9) - 3); // Line 25
Which line of codes prints the highest number?
A. Line 21
B. Line 22
C. Line 23
D. Line 24
E. Line 25
Answer: B
Explanation: The following is printed: 35 51
35
26
35
Q35. Given the code fragment:
for (int ii = 0; ii < 3;ii++) {
int count = 0;
for (int jj = 3; jj > 0; jj--) {
if (ii == jj) {
++count;
break;
}
}
System.out.print(count); continue; }
What is the result?
A. 011
B. 012
C. 123
D. 000
Answer: A
Q36. Which statement is true about Java byte code?
A. It can run on any platform.
B. It can run on any platform only if it was compiled for that platform.
C. It can run on any platform that has the Java Runtime Environment.
D. It can run on any platform that has a Java compiler.
E. It can run on any platform only if that platform has both the Java Runtime Environment and a Java compiler.
Answer: C
Q37. Given:
public class Natural {
private int i;
void disp() {
while (i <= 5) {
for (int i=1; i <=5;) {
System.out.print(i + " ");
i++;
}
i++;
}
}
public static void main(String[] args) {
new Natural().disp();
}
}
What is the result?
A. Prints 1 2 3 4 5 once
B. Prints 1 3 5 once
C. Prints 1 2 3 4 5 five times
D. Prints 1 2 3 4 5 six times
E. Compilation fails
Answer: D
Explanation: 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
Q38. Given:
What is the result?
A. Shining Sun Shining Sun Shining Sun
B. Shining Sun Twinkling Star Shining Sun
C. Compilation fails
D. A ClassCastException is thrown at runtime
Answer: D
Q39. Which of the following can fill in the blank in this code to make it compile?
A. abstract
B. public
C. default
D. It will not compile with any as interfaces cannot have non abstract methods.
E. It will compile without filling the blank.
Answer: C
Explanation:
From Java SE 8, we can use static and/or default methods in interfaces, but they should be non abstract methods. SO in this case using default in blank is completely legal. Hence option C is correct. Option A is incorrect as given method is not abstract, so can't use abstract there. Options B and E are incorrect as we can't have non abstract method interface if they are not default or static. https;//docs.oraclexom/javase/tutorial/java/Iandl/defaultmethods.html
Q40. Given the code fragment:
int b = 3;
if ( !(b > 3)) {
System.out.println("square ");
}{
System.out.println("circle ");
}
System.out.println("...");
What is the result?
A. square...
B. circle...
C. squarecircle...
D. Compilation fails.
Answer: C