Hello,
Could someone possibly explain this issue? I’ve read that whenever creating classes that do not have a version of the equals( ) method,
you should override the method provided by Object. Is the code below the proper way to do this? Thanks.
class K {
public boolean equals ( ) {
}
public static void main (
String [] args) {
K k1 = new K( );
K k2 = new K( );
if (k1.equals(k2)) {
System.out.println (“They equal”

;
}
else {
System.out.println (“Not Equal”

;
}
}
}