Create a Float object
Float(double value)
- Creates a Float object from double-type value and convert it to type float.
Float(float value)
- Creates a Float object for the primitive float argument.
Float(String s)
- Creates a Float object that represents the floating-point value of type float represented by the string.
public class Main {
public static void main(String[] args) {
Float float1 = new Float(0.0d);
Float float2 = new Float(0.1F);
Float float3 = new Float("0.2");
System.out.println(float1);
System.out.println(float2);
System.out.println(float3);
}
}
The output:
0.0
0.1
0.2
Home
Java Book
Essential Classes
Java Book
Essential Classes
Float:
- Float class
- MAX/MIN_VALUE Find out the Maximum value and Minimum value a float type can have
- Create a Float object
- Convert Float to byte, double, float, int, long and short
- Compare two float objects
- Infinite and Not A Number
- Convert float value to Hex String value
- Convert float value to String value
- Convert string value to float value
- Bit oriented calculation for float