Java.lang.Long.equals() Method


Java.lang.Long.equals() Method

package com.codingdict;



import java.lang.*;



public class LongDemo {



   public static void main(String[] args) {



      Long obj1 = new Long(79845);

      Long obj2 = new Long(79800);

      System.out.print("Is obj1 and obj2 equal ? ");

      System.out.println(obj1.equals(obj2));



      obj1 = new Long(45469);

      obj2 = new Long(45469);

      System.out.print("Is obj1 and obj2 equal ? ");

      System.out.println(obj1.equals(obj2));

   }

}