Oracle Java SE 8 Programmer I - 1z0-808 Exam Practice Test

Question 1
Consider:
Integer number = Integer.valueOff 808.1");
Which is true about the above statement?

Correct Answer: E
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 2
What is the name of the Java concept that uses access modifiers to protect variables and hide them within a class?

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

What is the result?

Correct Answer: A
Question 4
Given:
public class MyClass {
public static void main(String[] args) {
String s = " Java Duke ";
int len = s.trim().length();
System.out.print(len);
}
}
What is the result?

Correct Answer: B
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 5
A method is declared to take three arguments.
A program calls this method and passes only two arguments.
What is the results?

Correct Answer: C
Question 6
Given:

And given the commands:
javac Test.Java
Java Test Hello
What is the result?

Correct Answer: D
Question 7
Given:

And given the code fragment:

What is the result?

Correct Answer: D
Question 8
Given the code fragment:

What is the result?

Correct Answer: D
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 9
Given:
public class ColorTest {
public static void main(String[] args) {
String[] colors = {"red", "blue","green","yellow","maroon","cyan"};
int count = 0;
for (String c : colors) {
if (count >= 4) {
break;
}
else {
continue;
}
if (c.length() >= 4) {
colors[count] = c.substring(0,3);
}
count++;
}
System.out.println(colors[count]);
}
}
What is the result?

Correct Answer: A
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 10
Given the code fragment:

What is the result?

Correct Answer: F