public class RationalNumber extends Number
| Constructor and Description |
|---|
RationalNumber(int numerator,
int divisor) |
| Modifier and Type | Method and Description |
|---|---|
double |
doubleValue() |
static RationalNumber |
factoryMethod(long n,
long d) |
float |
floatValue() |
int |
intValue() |
boolean |
isValid() |
long |
longValue() |
RationalNumber |
negate() |
String |
toDisplayString() |
String |
toString() |
byteValue, shortValuepublic static final RationalNumber factoryMethod(long n, long d)
public RationalNumber negate()
public double doubleValue()
doubleValue in class Numberpublic float floatValue()
floatValue in class Numberpublic boolean isValid()
public String toDisplayString()
Copyright © 2007-2012. All Rights Reserved.