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 |
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?
Given the code format:
Which code fragment must be inserted at line 6 to enable the code to compile?
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?
