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:Jul 12, 2026
Rating
100%

Question 1

View the Exhibit.
public class Hat {
public int ID =0;
public String name = "hat";
public String size = "One Size Fit All";
public String color="";
public String getName() { return name; }
public void setName(String name) {
this.name = name;
}
}
Given
public class TestHat {
public static void main(String[] args) {
Hat blackCowboyHat = new Hat();
}
}
Which statement sets the name of the Hat instance?

Question 2

Given the code format:

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

Question 3

Given the code fragment:

What is the result?

Question 4

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?

Question 5

Which three statements are benefits of encapsulation?

Add Comments

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

insert code
Type the characters from the picture.