Oracle Java SE 8 Programmer I - 1z0-808 Exam Practice Test
Given:
public class Equal {
public static void main(String[] args) {
String str1 = "Java";
String[] str2 = {"J","a","v","a"};
String str3 = "";
for (String str : str2) {
str3 = str3+str;
}
boolean b1 = (str1 == str3);
boolean b2 = (str1.equals(str3));
System.out.print(b1+", "+b2);
}
What is the result?
public class Equal {
public static void main(String[] args) {
String str1 = "Java";
String[] str2 = {"J","a","v","a"};
String str3 = "";
for (String str : str2) {
str3 = str3+str;
}
boolean b1 = (str1 == str3);
boolean b2 = (str1.equals(str3));
System.out.print(b1+", "+b2);
}
What is the result?
Correct Answer: D
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
Given:

What is the result?


What is the result?

Correct Answer: C
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
Which of the following can fill in the blank in this code to make it compile? (Select 2 options.)


Correct Answer: A,C
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
Given the following class:

Which three pieces of code, when inserted independently, set the value of amount to 100?


Which three pieces of code, when inserted independently, set the value of amount to 100?

Correct Answer: A,E,F
Vote an answer
Which three statements are true about the structure of a Java class?
Correct Answer: B,C,F
Vote an answer
Which statement will empty the contents of a StringBuilder variable named sb?
Correct Answer: B
Vote an answer
Given the following classes:

Which two options fail to compile when placed at line n1 of the main method?

Which two options fail to compile when placed at line n1 of the main method?
Correct Answer: A,C
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).


