fork download
  1. class Foo {
  2. int x;
  3.  
  4. public Foo(int x) {
  5. this.x = x;
  6. }
  7.  
  8. @Override
  9. public boolean equals(Object o) {
  10. return this != o;
  11. }
  12. }
  13.  
  14. class Ideone
  15. {
  16. public static void main (String[] args) throws java.lang.Exception
  17. {
  18. Foo a = new Foo(2);
  19. Foo b = a;
  20.  
  21. System.out.println(a.equals(b));
  22. }
  23. }
Success #stdin #stdout 0.04s 4386816KB
stdin
Standard input is empty
stdout
false