Frog.java

  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package edu.nwmissouri.animalList;;

  7. /**
  8.  *
  9.  * @author Manoj Kota
  10.  */
  11. public class Frog extends Animal {

  12.    
  13.     public Frog(String name) {
  14.         super(name);
  15.     }

  16.     /**
  17.      *
  18.      * overrides speak method
  19.      */
  20.     @Override
  21.     public void speak()
  22.     {
  23.        System.out.println("Iam Frog,Iam Frog,Iam Frog");
  24.     }

  25.     /**
  26.      * overrides move method
  27.      */
  28.     @Override
  29.     public void move()
  30.     {
  31.        System.out.println("When i move,I jump,I jump");
  32.     }
  33.    
  34.     /**
  35.      * living method
  36.      */
  37.     public void habitate() {
  38.         System.out.println("It lives both on land and water");
  39.     }

  40.     /**
  41.      * type of animal
  42.      */
  43.     public void type() {
  44.         System.out.println("Its a amphibian");
  45.     }
  46.    
  47.     /**
  48.      * feeding method
  49.      */
  50.     public void feeding()
  51.     {
  52.        System.out.println("Feeds on algae and insects");
  53.     }

  54.     /**
  55.      * live span method
  56.      */
  57.     public void livespan()
  58.     {
  59.         System.out.println("lives upto 10-12 years");
  60.     }
  61.     /**
  62.      *
  63.      * @param DOB
  64.      * DOB parameter
  65.      * @param cuy
  66.      * current age parameter
  67.      * @return
  68.      */
  69.     public int age(int DOB,int cuy)
  70.     {
  71.         return cuy-DOB;
  72.     }
  73.     /**
  74.      * returns agec method
  75.      */
  76.     public void agec(){
  77.         System.out.println("Frog age: "+age(1999,2021));
  78.     }
  79.    
  80.    
  81. }