Create a project PersonSuperclass
that has four files in it:
The Person
class includes instance variables that identify a person by name
and age
(an int
value). Include accessor methods for those two attributes, as well as a celebrateBirthday
method that increases the person's age by one.
The Student
subclass inherits from Person
, and includes a String
instance variable major
that identifies that student's major in school. Include a getMajor
method as well.
The Instructor
subclass that also inherits from Person
, and includes a double
variable salary
that tracks the instructor's yearly pay, and a getSalary()
method.
A PersonSuperclassTester
program creates and tests instances of each of these classes.