Oracle Java SE 8 Programmer I - 1z1-808 Exam Practice Test
Given a java source file:

What changes will make this code compile?

What changes will make this code compile?
Correct Answer: E
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
Given the code fragments:

What is the result?

What is the result?
Correct Answer: D
Given the code fragment
int var1 = -5;
int var2 = var1--;
int var3 = 0;
if (var2 < 0) {
var3 = var2++;
} else {
var3 = --var2;
}
System.out.println(var3);
What is the result?
int var1 = -5;
int var2 = var1--;
int var3 = 0;
if (var2 < 0) {
var3 = var2++;
} else {
var3 = --var2;
}
System.out.println(var3);
What is the result?
Correct Answer: C
Which of the following can fill in the blank in this code to make it compile? (Select 2 options.)


Correct Answer: B,D
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
Given:

Which two code fragments can be inserted at line n1?

Which two code fragments can be inserted at line n1?
Correct Answer: B,E
Given the code fragment:

Which two code fragments inserted at line 10 print ****?

Which two code fragments inserted at line 10 print ****?
Correct Answer: E
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
Given:

What is the result?

What is the result?
Correct Answer: B
Given the code fragment:

What is the result?

What is the result?
Correct Answer: D
Given:

Which code fragment, when inserted at line 7, enables the code print true?


Which code fragment, when inserted at line 7, enables the code print true?

Correct Answer: C
Given the code fragment:

What is the result?

What is the result?
Correct Answer: B
Which of the following can fill in the blank in this code to make it compile?


Correct Answer: E
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
Given:

What is the result?

What is the result?
Correct Answer: E
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).