public class EqualsTest { public static void main(String args[]) { Long L = new Long(7); Integer J = new Integer(7); if (L.equals(J)) System.out.println("Equal"); else System.out.println("Not Equal"); } }