This Java program demonstrates the use of inheritance with the Person, Student, and Instructor classes.
Overview
Person: Represents a basic person with name and birth year.
Student: Extends Person with a major field.
Instructor: Extends Person with a salary field.
Usage
To use these classes:
Create instances of Person, Student, and Instructor.
Print details using their toString() methods.
Example
Example usage:
Person p = new Person("Alice", 1985);
Student s = new Student("Bob", 1998, "Computer Science");
Instructor i = new Instructor("Dr. Smith", 1970, 90000.1234);
System.out.println(p);
System.out.println(s);
System.out.println(i);