Is it possible to define a class called Thing so that the following method can return true under certain circumstances?
boolean weird(Thing s) { Integer x = new Integer(5); return s.equals(x); }
A.
The Thing class is free to override equals()
to do anything.
The method can return true when comparing the current instance to an instance of Integer.