SHARE
TWEET

kek

a guest Nov 14th, 2017 60 in 3 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Main {
  2.     public static void main(String[] args) {
  3.         People people = new People() {
  4.             @Override
  5.             public boolean equals(Object obj) {
  6.                 return !super.equals(obj);
  7.             }
  8.         };
  9.         test(people);
  10.     }
  11.  
  12.     public static void test(People a) {
  13.         System.out.println(a == a); // true
  14.         System.out.println(a.equals(a)); // false
  15.     }
  16.  
  17.     private static class People {}
  18. }
RAW Paste Data
Top