Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with this Java question in 1 hour please JAVA Using the files from the in-class assignment add two additional animals of your choice.

Need help with this Java question in 1 hour please

JAVA

Using the files from the in-class assignment add two additional animals of your choice. For each animal add two additional methods appropriate to your particular animal.

As the majority of the code for this program exists you will not need an algorithm. Use the 3 java classes below. Thank you

//Animal.java

public class Animal {

public Animal() {

System.out.println("A new animal has been created!");

}

public void sleep() {

System.out.println("An animal sleeps...");

}

public void eat() {

System.out.println("An animal eats...");

}

}

//Cat.java

public class Cat extends Animal {

public Cat() {

super();

System.out.println("A new cat has been created!");

}

@Override

public void sleep() {

System.out.println("A cat sleeps...");

}

@Override

public void eat() {

System.out.println("A cat eats...");

}

}

//Bird.java

public class Bird extends Animal {

public Bird() {

super();

System.out.println("A new bird has been created!");

}

@Override

public void sleep() {

System.out.println("A bird sleeps...");

}

@Override

public void eat() {

System.out.println("A bird eats...");

}

}

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

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions