Oracle
1Z0-809 · Question #183
1Z0-809 Question #183: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #183. The question stem and answer options stay visible for context.
Question
Given the code fragment:
public class Person {
String name;
int age = 25;
public Person(String name) {
this(); //line n1
setName(name);
}
public Person(String name, int age) {
Person(name); //line n2
setAge(age);
}
//setter and getter methods go here
public String show() {
return name + " " + age;
}
public static void main(String[] args) {
Person p1 = new Person("Jesse");
Person p2 = new Person("Walter", 52);
System.out.println(p1.show());
System.out.println(p2.show());
}
}
What is the result?
Options
- ACompilation fails at both line n1 and line n2.
- BCompilation fails only at line n1.
- CJesse 25
- DCompilation fails only at line n2.
Unlock 1Z0-809 to see the answer
You've previewed enough free 1Z0-809 questions. Unlock 1Z0-809 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.