public class Abc{
private int x;
private int y;
public synchronized void setX (int i) (x=1
public synchronized void setY (int i) (y=1
public synchronized void setXY (int i) (setX(i) ; sety(i)
public synchronized Boolean check() { return x != y; }
}
A) check() can never return true.
B) check() can return true when setXY is called by multiple threads.
C) check() can return true when multiple threads call setX and setY separately.
D) check can only return true if Abc is changed to allow x and y to be set separately.
I think the check() method can never return true.
Please comment......................
Thank you in advance
