1 package com.twister; 2 public class Mystery { 3 4 public static boolean isEqual(Object f1, Object f2){ 5 return f1.equals(f2); 6 } 7 8 public static void main(String[] args) { 9 Object f1 = new Object() 10 { 11 @Override 12 public boolean equals(Object obj) { 13 return false; 14 } 15 }; 16 Object f2 = f1; 17 18 System.out.println("f1 is equals to f2 : "+ (f1==f2));//prints true 19 System.out.println("f1 is equals to f2 : "+ isEqual(f1,f2));//prints false 20 } 21 }