java.lang.Double.equals()


java.lang.Double.equals()

package com.codingdict;



import java.lang.*;



public class DoubleDemo {



   public static void main(String[] args) {



      // compares this object against the specified object

      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("5");

      System.out.print(obj1 + " = " + obj2);

      System.out.println(" ?  " + obj1.equals(obj2));  

   }

}