Variables and Methods
Variables and Methods
Methods
inputs outputs
method
Square Root Method
Square root is a good example of a method.
Example:
int absoluteValue (int num){
if (num < 0)
return –num;
else
return num;
}
void Methods
A method of type void has a return statement
without any specified value. i.e. return;