In this exercise, we are going to look at creating a Superclass / Subclass relationship…
Jump to turn (6)
- 1In this exercise, we are going to look at creating a Superclass / Subclass relat
- 2In this exercise, you are going to build a hierarchy to create instrument object
- 3(no comments) For this exercise, you are going to create a Food superclass with
- 4You should test each class in main! Print the return values of the getters
- 5no comments In this problem, you’ll design and test a few classes that represent
- 6For this exercise, we are going to do a variation on our Student class by lookin
- User
In this exercise, we are going to look at creating a Superclass / Subclass relationship for Students.
Our superclass will be the Student class and contain the following instance variables:
String name - Student’s first and last name int id - Student’s ID number double gpa - Student’s GPA Our subclass will be StudentAthlete and contain the following instance variables:
String sport - Name of sport student plays String level - The level at which the student plays (varsity, junior varsity, etc) For this exercise, you will focus on the constructors for both classes. Remember that your subclass constructor needs to call the superclass constructor, so make sure you have the parameters to do that.