Class Elephant

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

public class Elephant extends Animal
This class defines the nature of the Elephant animal
  • Constructor Details

    • Elephant

      public Elephant(String name)
      This method is used to get the string from the parent class
      Parameters:
      name - Elephant
  • Method Details

    • speak

      public void speak()
      This is used to print animal speak
      Specified by:
      speak in class Animal
    • move

      public void move()
      This is used to print animal move
      Specified by:
      move in class Animal
    • profess

      public void profess()
      This method will initialize the values and calls the sum method
    • getElephantAddition

      public double getElephantAddition(double valueOne, int valueTwo)
      This method will calculate the sum of two numbers
      Parameters:
      valueOne - which is used to pass value of one in addition
      valueTwo - which is used to pass value of two in addition
      Returns:
      it returns the sum of two numbers