Core Java - Program sample
1) Object Comparison: import java.util.HashMap; import java.util.Map; public class TwoObjects { public static void main(String args[]){ TwoObjects t1 = new TwoObjects(); TwoObjects t2 = new TwoObjects(); System.out.println(t1==t2); System.out.println(t1.equals(t2)); Map<Object, String> map = new HashMap<Object, String>(); map.put(t1, "Shailesh"); map.put(t2, "Bhaskar"); System.out.println(map.get(t1)); System....