Oracle Java SE 11 Programmer I - 1z1-815 Exam Practice Test
What is the result?
Class StaticField {
static int i = 7;
public static void main(String[] args) {
StaticFied obj = new StaticField();
obj.i++;
StaticField.i++;
obj.i++;
System.out.println(StaticField.i + " "+ obj.i);
}
}
Class StaticField {
static int i = 7;
public static void main(String[] args) {
StaticFied obj = new StaticField();
obj.i++;
StaticField.i++;
obj.i++;
System.out.println(StaticField.i + " "+ obj.i);
}
}
Correct Answer: D
Vote an answer
Given:

It is required that if p instanceof Pair then p.isValid() returns true.
Which is the smallest set of visibility changes to insure this requirement is met?

It is required that if p instanceof Pair then p.isValid() returns true.
Which is the smallest set of visibility changes to insure this requirement is met?
Correct Answer: B
Vote an answer
Which describes an aspect of Java that contributes to high performance?
Correct Answer: B
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
What is the result?
public class StringReplace {
public static void main(String[] args) {
String message = "Hi everyone!";
System.out.println("message = " + message.replace("e", "X")); } }
public class StringReplace {
public static void main(String[] args) {
String message = "Hi everyone!";
System.out.println("message = " + message.replace("e", "X")); } }
Correct Answer: E
Vote an answer
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 three are valid replacements for foo so that the program will compiled and run?
public class ForTest {
public static void main(String[] args) {
int[] arrar = {1,2,3};
for ( foo ) {
}
}
}
public class ForTest {
public static void main(String[] args) {
int[] arrar = {1,2,3};
for ( foo ) {
}
}
}
Correct Answer: A,B,C
Vote an answer
Which two commands are used to identify class and module dependencies? (Choose two.)
Correct Answer: A,D
Vote an answer
Which two statements are true about the modular JDK? (Choose two.)
Correct Answer: C,D
Vote an answer

