I have to develop a program to assist Zoo staff to record required information of animals.Help with defining the methods!
So I have 4 classes.A 'Animal' class which is the parent.And 2 subclasses 'Dog' and 'Cat'.So I'm good with that part.But my Other Class The 'Zoo' class.I need to define actions to be done on adding and removing animal details as well as getting statistics of the animals.For example one method: public void addAnimal(Animal animal){ ..add logic } The Output should be: One Lion Added to the zoo... Help with defining this method please Also a method to remove animals from the zoo. public void removeAnimal(String animalID){...add logic} If I were to use an ArrayList how would I go about defining these methods? PS:The Animal class's constructor is Animal(String animalCategory, String animalType)..e.g(2 main categories_1.Cat=Lion,Cheetah,Tiger etc..2.Dog=Wolf,Domestic dog,fox etc... Animal Type=Lion,Cheetah,Dog etc...) So the 'Cat' class& 'Dog' class are subclasses of the Animal class and have respective constructors. Cat(String Id,String Colour,String name) & Dog has the same constructor parameters.