This project demonstrates the use of inheritance in Java by modeling a simple academic hierarchy. It includes a base Person class and several subclasses to represent different types of students.
- Person.java – Base class with common attributes like
name,age, andgender. - Student.java – Inherits from
Personand addsstudentIdandmajor. - UndergraduateStudent.java – Extends
Studentand includes ayear(e.g., freshman, sophomore). - GraduateStudent.java – Extends
Studentand includes athesisTitle. - Main.java – Demonstrates polymorphism and displays student information using overridden
displayInfo()methods.
- Object-Oriented Programming (OOP)
- Class Inheritance
- Constructor Chaining
- Method Overriding
- Polymorphism
- Compile all
.javafiles:javac *.java