|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Calculator
The Calculator class is designed primarily to illustrate how the Math class works. In fact, the only real difference is that the Math clas is part of a package, java.lang, which is automatically imported (since we always at least need to extend Object)
Method Summary | |
static double |
absoluteValue(double param)
the absolute value function for real numbers (decimals) |
static int |
absoluteValue(int param)
the absolute value function for integers (non-decimals) |
static double |
add(double param1,
double param2)
addition for real numbers (decimals) |
static int |
add(int param1,
int param2)
addition for integers (non-decimals) |
static double |
average(double param1,
double param2)
average taking in real numbers (decimals) |
static double |
average(int param1,
int param2)
average taking in integers (non-decimals) |
static double |
divide(double param1,
double param2)
division for real numbers (decimals) |
static int |
divide(int param1,
int param2)
division for integers (non-decimals) |
static boolean |
even(int param)
a boolean test of integers (non-decimals) |
static int |
factorial(int param)
recursive factorial. |
static double |
multiply(double param1,
double param2)
multiplication for real numbers (decimals) |
static int |
multiply(int param1,
int param2)
multiplication for integers (non-decimals) |
static boolean |
odd(int param)
a boolean test of integers (non-decimals) |
static double |
square(double param)
the squarring function for real numbers (decimals) |
static int |
square(int param)
the squarring function for integers (non-decimals) |
static double |
squareRoot(double param)
the square root function taking in reeal numbers (decimals) |
static double |
squareRoot(int param)
the square root function taking in integers (non-decimals) |
static double |
subtract(double param1,
double param2)
subtraction for real numbers (decimals) |
static int |
subtract(int param1,
int param2)
subtraction for integers (non-decimals) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static int add(int param1, int param2)
param1
- the first addendparam2
- the second addend
public static double add(double param1, double param2)
param1
- the first addendparam2
- the second addend
public static int subtract(int param1, int param2)
param1
- the first subtraction parameterparam2
- the second subtraction parameter
public static double subtract(double param1, double param2)
param1
- the first subtraction parameterparam2
- the second subtraction parameter
public static int multiply(int param1, int param2)
param1
- the first factorparam2
- the second factor
public static double multiply(double param1, double param2)
param1
- the first factorparam2
- the second factor
public static int divide(int param1, int param2)
param1
- the numeratorparam2
- the denominator
public static double divide(double param1, double param2)
param1
- the numeratorparam2
- the denominator
public static double average(int param1, int param2)
param1
- the first parameterparam2
- the second parameter
public static double average(double param1, double param2)
param1
- the first parameterparam2
- the second parameter
public static int square(int param)
param
- the number to be squarred
public static double square(double param)
param
- the number to be squarred
public static double squareRoot(int param)
param
- the number to be rooted
public static double squareRoot(double param)
param
- the number to be rooted
public static int factorial(int param)
param
- the parameter
public static int absoluteValue(int param)
param
- the parameter
public static double absoluteValue(double param)
param
- the parameter
public static boolean even(int param)
param
- the number to test for eveness
public static boolean odd(int param)
param
- the number to test for oddness
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |