Double/Float Flashcards
Float is identical to Double, with corresponding data type changes of course!
Constructor
- Double(double value)
Constructs a newly allocated Double object that represents the primitive double argument.
- Double(String s) throws NumberFormatException
Constructs a newly allocated Double object that represents the floating-point value of type double represented by the string. The string is converted to a double value as if by the valueOf method.
compare/compareTo
- int compare(double d1, double d2)
Compares the two specified double values.
- compareTo(Double anotherDouble)
Compares two Double objects numerically
equals(Object obj) and toString()
- equals(Object obj)
Compares this object against the specified object.
- String toString()
Returns a string representation of this Double object.
- String toString(double d)
Returns a string representation of the double argument.
long/float/double/byte/short/intValue
- Returns the value of this Double as a long/float/double/short/byte/int value
valueOf(double d/String s)
- Double valueOf(double d)
Returns a Double instance representing the specified double value.
- Double valueOf(String s) throws NumberFormatException
Returns a Double object holding the double value represented by the argument string s.
parseDouble(String s)
- parseDouble(String s) throws NumberFormatException
Returns a new double initialized to the value represented by the specified String, as performed by the valueOf method of class Double.