Online Access Free 1Z1-803 Practice Test

Exam Code:1Z1-803
Exam Name:Java SE 7 Programmer I
Certification Provider:Oracle
Free Question Number:216
Posted:Sep 02, 2026
Rating
100%

Question 1

Given:
class Base {
// insert code here
}
public class Derived extends Base{
public static void main(String[] args) {
Derived obj = new Derived();
obj.setNum(3);
System.out.println("Square = " + obj.getNum() * obj.getNum());
}
}
Which two options, when inserted independently inside class Base, ensure that the class is being properly encapsulated and allow the program to execute and print the square of the number?

Question 2

Given the fragments:

Which line causes a compilation error?

Question 3

Given:

What is the result?

Question 4

Given the code fragment:
public static void main(String[] args) { int iArray[] = {65, 68, 69}; iArray[2] = iArray[0]; iArray[0] = iArray[1]; iArray[1] = iArray[2]; for (int element : iArray) { System.out.print(element + " "); }

Question 5

Given:
package p1;
public class Test {
static double dvalue;
static Test ref;
public static void main(String[] args) {
System.out.println(ref);
System.out.println(dvalue);
}
}
What is the result?

Add Comments

Your email address will not be published. Required fields are marked *

insert code
Type the characters from the picture.