Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 720 Bytes

File metadata and controls

25 lines (19 loc) · 720 Bytes

Question 4: Inheritance happens when a class inherits attributes and objects from another class.

In the question, create a child class called Student that gets attributes from a parent class called Person.

The Student class should have additional properties and methods: Property:

  • gradeLevel (String)

Method:

  • study() - The study method takes in a string and should output: "I love studying " ex. I love studying Algebra

You can use pseudocode or read through how Java does inheritance - Link

class Person {
    private String firstName;
    private String lastName;
    private int age;
}

//Modify this code
class Student {}
//End code