java.lang.Float.equals()


java.lang.Float.equals()

package com.codingdict;



import java.lang.*;



public class FloatDemo {



   public static void main(String[] args) {



      // compares this object against the specified object

      Float obj1 = new Float("10");

      Float obj2 = new Float("10.0");

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

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



      obj1 = new Float("20");

      obj2 = new Float("67.20");

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

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

   }

}