FrogGroup.java

  1. package edu.nwmissouri.animalList;

  2. import java.util.ArrayList;

  3. /**
  4.  *
  5.  * @author Manoj Kota
  6.  */
  7. public class FrogGroup {
  8.     private static ArrayList<Frog> grp;

  9.    //public static int create()

  10.     /**
  11.      *
  12.      * @return
  13.      * returns create method
  14.      */
  15.     public static int create()
  16.    {
  17.        grp=new ArrayList<>();
  18.        Frog f=new Frog("poison");
  19.        grp.add(f);
  20.        grp.add(new Frog("glass"));
  21.        grp.add(new Frog("kaloula"));
  22.        return grp.size();
  23.    }


  24.     /**
  25.      *
  26.      *runs the Frog attributes
  27.      */

  28.     public static void run()
  29.    {
  30.        System.out.println("My animal is Frog");
  31.        grp.forEach(Frog->{
  32.            Frog.speak();
  33.            Frog.move();
  34.            Frog.habitate();
  35.            Frog.type();
  36.            Frog.feeding();
  37.            Frog.livespan();
  38.            Frog.agec();
  39.    
  40.            
  41.        });
  42.    }

  43.    

  44. }