Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

3. You can gain power by making others feel important.

Answered: 1 week ago

Question

Write down the circumstances in which you led.

Answered: 1 week ago