Oracle 1Z1-803 Actual Free Exam Questions & Community Discussion

  • Exam Code/Number: 1Z1-803
  • Exam Name/Title: Java SE 7 Programmer I
  • Certification Provider: Oracle
  • Corresponding Certification: Java and Middleware
  • Exam Questions: 216
  • Updated On: Jul 13, 2026
1.class StaticMethods {
2.static void one() {
3.two();
4.StaticMethods.two();
5.three();
6.StaticMethods.four();
7.}
8.static void two() { }
9.void three() {
10.
one();
11.
StaticMethods.two();
12.
four();
13.
StaticMethods.four();
14.
}
15.
void four() { }
16.
}
Which three lines are illegal?
Correct Answer: C,G,H Vote an answer
Given:
public class ComputeSum {
public int x;
public int y;
public int sum;
public ComputeSum (int nx, int ny) {
x = nx; y =ny;
updateSum();
}
public void setX(int nx) { x = nx; updateSum();}
public void setY(int ny) { x = ny; updateSum();}
void updateSum() { sum = x + y;}
}
This class needs to protect an invariant on the sum field.
Which three members must have the private access modifier to ensure that this invariant is maintained?
Correct Answer: C,D,F Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
Given the fragments:

Which line causes a compilation error?
Correct Answer: A Vote an answer
Given:
public class MyFor {
public static void main(String[] args) {
for (int ii = 0; ii < 4; ii++) {
System.out.println("ii = "+ ii);
ii = ii +1;
}
}
}
What is the result?
Correct Answer: C Vote an answer
Which statement is true about the default constructor of a top-level class?
Correct Answer: B Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
Given:

What is the result?
Correct Answer: A Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
Which two are valid declarations of a two-dimensional array?
Correct Answer: B,D Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
Which three statements are benefits of encapsulation?
Correct Answer: C,E,F Vote an answer
Given the code fragment: What could expression1 and expression2 be, respectively, in order to produce output -8, 16?
Correct Answer: D Vote an answer
Given the code fragment:
StringBuilder sb = new StringBuilder ( ) ; Sb.append ("world");
Which code fragment prints Hello World?
Correct Answer: A Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
Given the code in a file Traveler.java:

And the commands:
Javac Traveler.java
Java Traveler Java Duke
What is the result?
Correct Answer: C Vote an answer
0
0
0
10