SHARE
TWEET

Untitled

a guest Jun 20th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Animal {
  2.     public String name;
  3.     public String species;
  4.     public int age;
  5.     Animal(){}
  6.     public Animal(String name, String species, int id, int age) {
  7.         this.name = name;
  8.         this.species = species;
  9.         this.age = age;
  10.     }
  11.     }
  12.  
  13.  class Lion extends Animal{
  14.     Lion(){}
  15.     Lion (String name, String species, int age){
  16.  
  17. }
  18.  class Giraffe extends Animal{
  19.     Giraffe(){}
  20.     Giraffe(String name, String species int age),
  21.    }
  22. class JoyeLionChild extends Animal{
  23. Lion(String name="Joye", int age=0, String species),
  24. }
  25. class FifiGiraffeChild extends Animal{
  26. Giraffe(String name="Fifi", int age=0, String species),
  27.  
  28. public class Zoo {
  29.     private ArrayList<Animal> animals = new ArrayList<>();
  30.  
  31.   public void addAnimal(Animal a)
  32.   {
  33.     animals.add(a);
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top