public class Fraction
extends java.lang.Object
| Constructor and Description |
|---|
Fraction(int numerator,
int denominator)
Construct a normalized fraction number
|
| Modifier and Type | Method and Description |
|---|---|
int |
getDenominator()
Denominator getter
|
int |
getNumerator()
Numerator getter
|
Fraction |
multiply(Fraction f)
Multiply two fractions, the this with the f parameter
|
Fraction |
sum(Fraction f)
Sum two fractions, the this with the f parameter
|
public Fraction(int numerator,
int denominator)
numerator - the numerator of the fractiondenominator - the denominator of the fractionpublic int getNumerator()
public int getDenominator()
public Fraction multiply(Fraction f)
f - The other fraction to multiply