Question: Create a class called Fish which represents all fishes. Your assignment is to write a java class that represents one specific kind of fish. For

Create a class called Fish which represents all fishes. Your assignment is to write a java class that represents one specific kind of fish.

For example, if you were to create a Shark class, you have to add some attributes/properties that are unique to the shark (not specified in the Fish class), for example, length of a shark. Then, create constructors (with and without parameters) that accept and initialize the new object variable(s), and also call super classs constructor. The Shark class should also overwrite the Fish classs greeting() method so it has a unique greeting, for example, a sharks greeting can print out, Hello, I am a Shark!!. Last, the subclass should also have a unique method that Fish class doesnt have. For example, Shark class can have bite() method that prints out I can Bite!! which the Fish class doesnt have.

[Dont use Shark class in your solution. Come up with your own example.]

So, create at least one class that inherits from Fish class. The subclass(es) must meet the following requirements:

1. Subclass must call the super class's constructor.

2. Subclass must overwrite super class's greeting() method.

3. Subclasses must have a unique method.

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!