Example usage for java.lang Float valueOf

List of usage examples for java.lang Float valueOf

Introduction

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

Prototype

@HotSpotIntrinsicCandidate
public static Float valueOf(float f) 

Source Link

Document

Returns a Float instance representing the specified float value.

Usage

From source file:Main.java

public static void main(String[] args) {

    float a = (Float.valueOf(args[0])).floatValue();
    float b = (Float.valueOf(args[1])).floatValue();

}

From source file:Main.java

public static void main(String[] args) {
    Float floatObject2 = Float.valueOf(1.1F);
    System.out.println(Float.toString(floatObject2));

}

From source file:Main.java

public static void main(String[] args) {
    Float floatObject2 = Float.valueOf(1.1F);
    System.out.println(floatObject2.toString());

}

From source file:Main.java

public static void main(String[] args) {
    Float floatObject2 = Float.valueOf(1.1F);
    System.out.println(floatObject2);
    System.out.println(Float.toHexString(floatObject2));

}

From source file:Main.java

public static void main(String[] args) throws Exception {

    Float f = Float.valueOf("0.2").floatValue();
}

From source file:Main.java

public static void main(String[] args) {

    System.out.println("Value = " + Float.valueOf(2.75f));
}

From source file:Main.java

public static void main(String[] args) {

    String str = "0.56";

    System.out.println("Value = " + Float.valueOf(str));
}

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 fObj1 = new Float("10.64");
    System.out.println(fObj1);//  ww w  .  j a va  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:MainClass.java

public static void main(String args[]) {

    Boolean bool = Boolean.valueOf("true");
    Character c = new Character('c');
    Byte b = Byte.valueOf("12");
    Short s = Short.valueOf("2");
    Integer i = Integer.valueOf("13245");
    Long l = Long.valueOf("12341234");
    Float f = Float.valueOf("11234.1234");
    Double d = Double.valueOf("43213241234.123412341234");

    System.out.println(bool);/* w  w w . j  av a2 s .c  o  m*/
    System.out.println(c);
    System.out.println(b);
    System.out.println(s);
    System.out.println(i);
    System.out.println(l);
    System.out.println(f);
    System.out.println(d);
}