public Demo 96. What are the first 2 lines of output? { public static void main(String args[]) (A) Person Parameter Constructor { Student Parameter Constructor Student tom = new Student(12); tom.showData(); } (B) Student Parameter Constructor } Person Parameter Constructor (C) Person Parameter Constructor class Person { Person Parameter Constructor private int age; (D) Student Parameter Constructor public Person() Student Parameter Constructor { System.out.println("Person Parameter Constructor"); age = 17; ### (E) No Output. } This program does not compile. public int getAge() { return age; } } 97. What are the last 2 lines of output? class Student extends Person (A) Student's Grade is 12 { Student's Age is 17 private int grade; public Student(int g) (B) Student's Grade is 17 { Student's Age is 12 grade = g; System.out.println("Student Parameter Constructor"); (C) Student's Grade is 17 } Student's Age is 17 public int getGrade() { return grade; } (D) Student's Grade is 12 public void showData() Student's Age is 12 { System.out.println("Student's Grade is " + grade); ### (E) No Output. System.out.println("Student's Age is " + age); } This program does not compile. } 98. When an object of a subclass is instantiated, the constructor of the
public Demo { public static void main(String args[]) { Student tom = new Student(12); tom.showData(); } } class Person { private int age; public Person() { System.out.println("Person Parameter Constructor"); age = 17; } public int getAge() { return age; } } class Student extends Person { private int grade; public Student(int g) { grade = g; System.out.println("Student Parameter Constructor"); } public int getGrade() { return grade; } public void showData() { System.out.println("Student's Grade is " + grade); System.out.println("Student's Age is " + age); } } 96. What are the first 2 lines of output? (A) Person Parameter Constructor Student Parameter Constructor (B) Student Parameter Constructor Person Parameter Constructor (C) Person Parameter Constructor Person Parameter Constructor (D) Student Parameter Constructor Student Parameter Constructor ### (E) No Output. This program does not compile. 97. What are the last 2 lines of output? (A) Student's Grade is 12 Student's Age is 17 (B) Student's Grade is 17 Student's Age is 12 (C) Student's Grade is 17 Student's Age is 17 (D) Student's Grade is 12 Student's Age is 12 ### (E) No Output. This program does not compile. 98. When an object of a subclass is instantiated, the constructor of the
SemExam0111Key.docx