List of usage examples for java.lang Float Float
@Deprecated(since = "9") public Float(String s) throws NumberFormatException
From source file:Main.java
public static void main(String[] args) { Float floatObject = new Float("10.01"); long l = floatObject.longValue(); System.out.println("long:" + l); }
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.isNaN()); System.out.println(f2 + " = " + f2.isNaN()); }
From source file:Main.java
public static void main(String[] args) { Float floatObject = new Float("10.01"); byte b = floatObject.byteValue(); System.out.println("byte:" + b); }
From source file:Main.java
public static void main(String[] args) { Float floatObject = new Float("10.01"); int i = floatObject.intValue(); System.out.println("int:" + i); }
From source file:Main.java
public static void main(String[] args) { Float floatObject = new Float("10.01"); short s = floatObject.shortValue(); System.out.println("short:" + s); }
From source file:Main.java
public static void main(String[] args) { Float floatObject1 = new Float("10.0001"); Float floatObject2 = new Float("10.0002"); System.out.println(Float.compare(floatObject1, floatObject2)); }
From source file:Main.java
public static void main(String[] args) { Float fObj1 = new Float("10.64"); System.out.println(fObj1);/*w w w . j a v a 2 s . c o m*/ Float fObj2 = Float.valueOf("10.76"); System.out.println(fObj2); float f = Float.parseFloat("7.39"); System.out.println(f); }
From source file:Main.java
public static void main(String[] args) { Float obj1 = new Float("10"); Float obj2 = new Float("10.0"); System.out.print(obj1 + " = " + obj2); System.out.println(" ? " + obj1.equals(obj2)); obj1 = new Float("20"); obj2 = new Float("6.000000"); System.out.print(obj1 + " = " + obj2); System.out.println(" ? " + obj1.equals(obj2)); }
From source file:Main.java
public static void main(String[] args) { Float floatObject1 = new Float("10.0001"); Float floatObject2 = Float.valueOf((float) 0.0 / (float) (0.0)); System.out.println(floatObject2); System.out.println(floatObject1.compareTo(floatObject2)); }
From source file:Main.java
public static void main(String[] args) { float f = 10.56f; Float fObj = new Float(f); System.out.println(fObj);// w w w . j av a 2 s . c o m }