Description
This Java program demonstrates basic inheritance and object-oriented programming concepts through a simple student management system. It includes two classes: Student and Undergrad.
Student Class: Represents a student with name and number attributes, with methods to get and set these values. It also provides a toString method for displaying the student's details.
Undergrad Class: Inherits from Student and adds major and year attributes specific to undergraduate students. It overrides the toString method to include these additional details.
Main Class (Inh_1): The entry point of the program, where instances of Student and Undergrad are created, modified, and displayed, showcasing inheritance and method overriding.
This program is a simple demonstration of inheritance, encapsulation, and method overriding in Java.