Example usage for java.lang Double Double

List of usage examples for java.lang Double Double

Introduction

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

Prototype

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

Source Link

Document

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

Usage

From source file:Main.java

public static void main(String[] args) {
    Double doubleObject = new Double("10.01");
    double d = doubleObject.doubleValue();
    System.out.println("double:" + d);

}

From source file:Main.java

public static void main(String[] args) {
    Double doubleObject = new Double("10.01");

    float f = doubleObject.floatValue();
    System.out.println("float" + f);
}

From source file:Main.java

public static void main(String[] args) {
    Double dObj1 = new Double("100.564");
    System.out.println(dObj1);//w ww .java 2s  .co m

    Double dObj2 = Double.valueOf("10.6");

    System.out.println(dObj2);
    double d = Double.parseDouble("76.39");
    System.out.println(d);
}

From source file:Main.java

public static void main(String[] args) {
    Double obj1 = new Double("2");
    Double obj2 = new Double("2.0");
    System.out.print(obj1 + " = " + obj2);
    System.out.println(" ?  " + obj1.equals(obj2));

    obj1 = new Double("3");
    obj2 = new Double("4");
    System.out.print(obj1 + " = " + obj2);
    System.out.println(" ?  " + obj1.equals(obj2));
}

From source file:MainClass.java

public static void main(String[] args) {
    double d = 3.5;
    Double d2 = new Double(d);
    System.out.println(d2.doubleValue());
}

From source file:Main.java

public static void main(String[] args) {
    double d = 10.56;
    Double dObj = new Double(d);
    System.out.println(dObj);/* www . j av a2 s  . c o  m*/
}

From source file:Main.java

public static void main(String[] args) {
    Double dObj = new Double("10.50");
    byte b = dObj.byteValue();
    System.out.println(b);//from  ww w  .java 2s.  c o m

    short s = dObj.shortValue();
    System.out.println(s);

    int i = dObj.intValue();
    System.out.println(i);

    float f = dObj.floatValue();
    System.out.println(f);

    double d = dObj.doubleValue();
    System.out.println(d);
}

From source file:Main.java

public static void main(String[] args) {
    Double d = new Double("123.45678");

    BigDecimal bg = BigDecimal.valueOf(d);

    System.out.println(bg);//from   w  w  w .  j a  v a2  s.  c o m
}

From source file:Main.java

public static void main(String[] args) {
    double d = 10.10;
    Double dObj1 = new Double(d);

    System.out.println(dObj1);/*from  ww  w . ja  v a  2s  . c  om*/

    Double dObj3 = new Double("25.34");
    System.out.println(dObj3);
}

From source file:Main.java

public static void main(final String[] args) {
    Class cls = new Integer("0").getClass();
    cls.isInstance(new Double("1.2").getClass());
    Number.class.isInstance(123);
    cls = Number.class;
    cls.isAssignableFrom(new Double("1.2").getClass());
}