Question: need help with java oop Add two more animal classes to the Jungle example from the Polymorphism code folder and modify the fillBag() method to



need help with java oop
Add two more animal classes to the Jungle example from the Polymorphism code folder and modify the fillBag() method to include your new animals as possible animals. public class Jungle { static Animal a; static Animal []bag; static Tiger t; static Dog d; static Snake s; Run | Debug public static void main(String[] args) { bag = new Animal[10]; t = new Tiger(); d = new Dog(); s = new Snake(); System.out.println("get tiger to move"); t.move(); System.out.println("get snake to move"); s.move(); System.out.println("hold onto tiger with Animal reference"); a = t; System.out.println("Use Animal reference to get Tiger to move"); a.move(); //Try to get Tiger object to growl - if you do you'll get an error //Try to put Tiger object back onto the Tiger reference System.out.println("Fill up animal bag"); fillBag(); System.out.println("see how each animal moves"); for(int i=0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
