Example usage for java.lang Float Float

List of usage examples for java.lang Float Float

Introduction

In this page you can find the example usage for java.lang Float Float.

Prototype

@Deprecated(since = "9")
public Float(String s) throws NumberFormatException 

Source Link

Document

Constructs a newly allocated Float object that represents the floating-point value of type float represented by the string.

Usage

From source file:Main.java

public static void main(String[] args) {
    Float fObj = new Float(10.25);
    String str = fObj.toString();
    System.out.println(str);//w w  w. j  a v  a2 s.  c o  m
}

From source file:Main.java

public static void main(String[] args) {
    Float f = new Float("25.57f");

    int retval = f.hashCode();
    System.out.println("Value = " + retval);
}

From source file:Main.java

public static void main(String[] args) {
    Float float2 = new Float(0.1F);

    System.out.println(float2);

}

From source file:Main.java

public static void main(String[] args) {
    Float float1 = new Float(0.0d);

    System.out.println(float1);

}

From source file:Main.java

public static void main(String[] args) {

    Float f1 = new Float(1.0 / 0.0);
    Float f2 = new Float(0.0 / 0.0);

    System.out.println(f1 + " = " + f1.isInfinite());
    System.out.println(f2 + " = " + f2.isInfinite());
}

From source file:Main.java

public static void main(String[] args) {

    Float float3 = new Float("0.2");

    System.out.println(float3);

}

From source file:Main.java

public static void main(String[] args) {

    Float f1 = new Float(-1.0 / 0.0);
    Float f2 = new Float(0.0 / 0.0);

    System.out.println(f1 + " = " + Float.isNaN(f1));
    System.out.println(f2 + " = " + Float.isNaN(f2));
}

From source file:Main.java

public static void main(String[] args) {

    Float f1 = new Float(1.0 / 0.0);
    Float f2 = new Float(0.0 / 0.0);

    System.out.println(f1 + " = " + Float.isInfinite(f1));
    System.out.println(f2 + " = " + Float.isInfinite(f2));
}

From source file:Main.java

public static void main(String[] args) {
    Float floatObject = new Float("10.01");
    double b = floatObject.doubleValue();
    System.out.println("double:" + b);
}

From source file:Main.java

public static void main(String[] args) {
    Float floatObject = new Float("10.01");
    float b = floatObject.floatValue();
    System.out.println("float:" + b);
}