The following example creates two Double objects:
public class Main { public static void main(String args[]) { Double d1 = new Double(3.14159); Double d2 = new Double("314159E-5"); System.out.println(d1 + " = " + d2 + " -> " + d1.equals(d2)); }/* w ww. ja va2s . c o m*/ }