Package edu.nwmissouri.animalList
Class Elephant
java.lang.Object
edu.nwmissouri.animalList.Animal
edu.nwmissouri.animalList.Elephant
This class defines the nature of the Elephant animal
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
getElephantAddition
(double valueOne, int valueTwo) This method will calculate the sum of two numbersvoid
move()
This is used to print animal movevoid
profess()
This method will initialize the values and calls the sum methodvoid
speak()
This is used to print animal speak
-
Constructor Details
-
Elephant
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 -
move
public void move()This is used to print animal move -
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 additionvalueTwo
- which is used to pass value of two in addition- Returns:
- it returns the sum of two numbers
-