What is the output of the following program? (Assume all the…
What is the output of the following program? (Assume all the classes are in separate files.) public class Person { public Person() { System.out.println(“Person”); }}public class Student extends Person { public Student() { System.out.println(“Student”); }}public class CollegeStudent extends Student { public CollegeStudent() { System.out.println(“CollegeStudent”); } public CollegeStudent(String name) { System.out.println(“CollegeStudent with name setup”); }}public class Main { public static void main(String[] args) { CollegeStudent s = new CollegeStudent(“Sally”); }}
Read Details