Java Float(String s) Constructor
Syntax
Float(String s) constructor from Float has the following syntax.
public Float(String s) throws NumberFormatException
Example
In the following code shows how to use Float.Float(String s) constructor.
public class Main {
public static void main(String[] args) {
/*from w w w . j a v a2 s.c om*/
Float float3 = new Float("0.2");
System.out.println(float3);
}
}
The output: