Professional Documents
Culture Documents
Hands-on Activity
Animal Sounds
Objective:
Software Requirements:
▪ Latest version of NetBeans IDE
▪ Java Development Kit (JDK) 8
Procedure:
1. Create a public class named RunAnimal. This class shall contain the main method.
2. Add four (4) Java classes without modifiers named Animal (abstract), Bird, Cat, and Dog.
Animal should be the parent class of the other three (3) classes.
3. For the Animal class, declare these three (3) abstract methods: eat(), sleep(), and makeSound().
4. Use only println() for the Bird, Cat, and Dog classes. Create appropriate statements based on
the animal. See sample output below.
5. For the RunAnimal class, use nextLine() and equalsIgnoreCase() to produce an output similar
to the provided sample output.
Sample Output: