Class Duck

java.lang.Object
edu.nwmissouri.animalList.Animal
edu.nwmissouri.animalList.Duck

public class Duck extends Animal
Duck class (derived subclass of the superclass Animal)
Author:
Sandhya Nidigonda
  • Constructor Details

    • Duck

      public Duck(String name)
      Duck constructor
      Parameters:
      name - - the name of this Animal is Duck
  • Method Details

    • speak

      public void speak()
      Description copied from class: Animal
      abstract speak() - has no implementation
      Specified by:
      speak in class Animal
    • eat

      public void eat()
    • move

      public void move()
      Description copied from class: Animal
      abstract move() - has no implementation
      Specified by:
      move in class Animal
    • duckEggsProduction

      public int duckEggsProduction(int monthlyEggsProduction, int monthsinYear)
      Custom Duck function - your class must use a unique function name
      Parameters:
      monthlyEggsProduction -
      monthsinYear -
      Returns:
      int
    • studentDuck

      public void studentDuck()