Given the class hierarchy below. Could the symmetry of equal…
Given the class hierarchy below. Could the symmetry of equals() be violated? If yes, provide client code that demonstrates that. class A { int x; public A(int x) {this.x = x;} public boolean equals(Object o) { if (!(o instanceof A)) return false; A a = (A)o; return this.x == a.x; } } class B extends A { int y; public B(int x, int y) {super(x); this.y = y;} public boolean equals(Object o) { if (!(o instanceof B)) return false; B b = (B)o; return super.equals(o); } }