Students, please be sure to log in. This site does not use cookies and does not track/store work submitted when not signed in.
Unit 9 Problems
Java Reference Sheet
Student
Write a class called Student
that is a sub-class of the Person
the class is shown below. For this problem, you're only practicing how to write the header for a child class. Include the curly bracket for the body of the class but do not add additional code in the body.
public class Person{
private int age; //a Person has an age
private String profession; //a Person has a profession
}
Syntax for extending is as shown:
public class SubClass extends SuperClass{
} Example: public class Employee extends Person{ }
In the example above, Employee is a subclass of Person.