Oracle 1Z1-803 Actual Free Exam Questions & Community Discussion
Given the code format:

Which code fragment must be inserted at line 6 to enable the code to compile?

Which code fragment must be inserted at line 6 to enable the code to compile?
Correct Answer: A
Vote an answer
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: B
Vote an answer
Given:
public class TestLoop1 { public static void main(String[] args) { int a = 0, z=10; while (a < z) { a++;
--z;
}
System.out.print(a + " : " + z);
}
}
What is the result?
public class TestLoop1 { public static void main(String[] args) { int a = 0, z=10; while (a < z) { a++;
--z;
}
System.out.print(a + " : " + z);
}
}
What is the result?
Correct Answer: A
Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
A method is declared to take three arguments. A program calls this method and passes only two arguments. What is the results?
Correct Answer: B
Vote an answer
Given:
public class Marklist {
int num;
public static void graceMarks(Marklist obj4) {
obj4.num += 10;
}
public static void main(String[] args) {
MarkList obj1 = new MarkList();
MarkList obj2 = obj1;
MarkList obj1 = null;
obj2.num = 60;
graceMarks(obj2);
}
}
How many objects are created in the memory runtime?
public class Marklist {
int num;
public static void graceMarks(Marklist obj4) {
obj4.num += 10;
}
public static void main(String[] args) {
MarkList obj1 = new MarkList();
MarkList obj2 = obj1;
MarkList obj1 = null;
obj2.num = 60;
graceMarks(obj2);
}
}
How many objects are created in the memory runtime?
Correct Answer: D
Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
Given:

The class is poorly encapsulated. You need to change the circle class to compute and return the area instead.
Which two modifications are necessary to ensure that the class is being properly encapsulated?

The class is poorly encapsulated. You need to change the circle class to compute and return the area instead.
Which two modifications are necessary to ensure that the class is being properly encapsulated?
Correct Answer: A,D
Vote an answer
Given:
abstract class A1 { public abstract void m1(); public void m2() { System.out.println("Green"); }
}
abstract class A2 extends A1 { public abstract void m3(); public void m1() { System.out.println("Cyan"); } public void m2() { System.out.println("Blue"); }
}
public class A3 extends A2 { public void m1() { System.out.println("Yellow"); }
public void m2() { System.out.println("Pink"); }
public void m3() { System.out.println("Red"); }
public static void main(String[] args) {
A2 tp = new A3();
tp.m1();
tp.m2();
tp.m3();
}
}
What is the result?
abstract class A1 { public abstract void m1(); public void m2() { System.out.println("Green"); }
}
abstract class A2 extends A1 { public abstract void m3(); public void m1() { System.out.println("Cyan"); } public void m2() { System.out.println("Blue"); }
}
public class A3 extends A2 { public void m1() { System.out.println("Yellow"); }
public void m2() { System.out.println("Pink"); }
public void m3() { System.out.println("Red"); }
public static void main(String[] args) {
A2 tp = new A3();
tp.m1();
tp.m2();
tp.m3();
}
}
What is the result?
Correct Answer: D
Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
0
0
0
10




