✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
// Person.javapackage unit01.quiz;public abstract class Person { public abstract String talk();}// Student.javapackage unit01.quiz;public class Student extends Person{ private final String name; public Student(String name){ this.name = name; } // Student tells own name public String talk(){ return name; }} // Teacher.javapackage unit01.quiz;public class Teacher extends Person{ private final String subject; public Teacher(String subject){ this.subject = subject; } // Teacher tells about subject public String talk(){ return subject; }}// Main.javapackage unit01.quiz;public class Main { public static void main(String[] args) { Student student = new Student("Paul"); Teacher teacher = new Teacher("Maths"); }} Which of the following statements in main() are correct (Syntax correct)?1) System.out.println("Student " + student.name + " is being taught " + teacher.subject);2) System.out.println("Student " + Student.name + " is being taught " + Teacher.subject);3) System.out.println("Student " + Student.talk() + " is being taught " + Teacher.talk());4) System.out.println("Student " + student.talk() + " is being taught " + teacher.talk());