Double/Float Flashcards

Float is identical to Double, with corresponding data type changes of course!

1
Q

Constructor

A
  • 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

compare/compareTo

A
  • int compare(double d1, double d2)

Compares the two specified double values.

  • compareTo(Double anotherDouble)

Compares two Double objects numerically

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

equals(Object obj) and toString()

A
  • 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

long/float/double/byte/short/intValue

A
  • Returns the value of this Double as a long/float/double/short/byte/int value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

valueOf(double d/String s)

A
  • 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

parseDouble(String s)

A
  • 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly