Question: 2. Starting with your class Person from Homework 05, define a class Student that extends Person. Then do the following: (a) In addition to the

 2. Starting with your class Person from Homework 05, define a

2. Starting with your class Person from Homework 05, define a class Student that extends Person. Then do the following: (a) In addition to the properties of a Person, a Student has the following proper ties: a student ID number, a School (define a simple class for this), and a major (e.g., "Computer Science"; use a string). (b) You will need a constructor for the Student class. In Java, your constructor must call the parent class constructor using super with appropriate arguments. A student always has an id number and school, so these should be arguments to (c) Add a method greeting to your Person class that returns a short greeting that (d) Override this method in your Student class so that students whose major is Illustrate all of these with a main method in either the Student class or a separate your constructor, as well as whatever is required for a Person. a person might use (e.g., "Hello"). Computer Science say "Greetings Earthling!" and other students say "Hey." test class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!