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 double1 = new Double(0.0 / 0.0);

    System.out.println(double1.isNaN());

}

From source file:Main.java

public static void main(String[] args) {
    Double double1 = new Double(1 / 0.0);

    System.out.println(Double.isInfinite(double1));

}

From source file:Main.java

public static void main(String[] args) {
    Double double1 = new Double(1 / 0.0);

    System.out.println(double1.isInfinite());

}

From source file:Main.java

public static void main(String[] args) {
    Double double1 = new Double(1.1);
    Double double2 = new Double("1.2");

    System.out.println(Double.compare(double1, double2));

}

From source file:Main.java

public static void main(String[] args) {
    Double double1 = new Double(1.1);
    Double double2 = new Double("1.2");

    System.out.println(double1.compareTo(double2));

}

From source file:Main.java

public static void main(String[] args) {
    Double d1 = new Double(+0.0);
    System.out.println(d1.doubleValue());

    Double d2 = new Double(-0.0);
    System.out.println(d2.doubleValue());
    System.out.println(d1.equals(d2));
    System.out.println(+0.0 == -0.0);

}

From source file:Main.java

public static void main(String[] args) {
    Double doubleObject = new Double("10.01");
    long l = doubleObject.longValue();
    System.out.println("long:" + l);
}

From source file:Main.java

public static void main(String[] args) {
    Double doubleObject = new Double("10.01");
    byte b = doubleObject.byteValue();
    System.out.println("byte:" + b);
}

From source file:Main.java

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

    int i = doubleObject.intValue();
    System.out.println("int:" + i);
}

From source file:Main.java

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

    short s = doubleObject.shortValue();
    System.out.println("short:" + s);
}