Contain function() in hashSet
Today when I tried to solve a problem, I came across a weird problem. Look at below code: public class test { static class Point { int a; public Point(int a) { this.a = a; } } public static void test1() { Point element = new Point(1); HashSet<Point> hs = new HashSet<Point>(); hs.add(element); element.a = 2;… Read More »