public class ClassB {
ClassA classA=new ClassA(0, 0);
public ClassB() {}
public synchronized void setValues(int height, int wifth) throws IllegalAccessException{
if(height<0||wifth<0)throw new IllegalAccessException();
classA.height=height;
classA.wifth=wifth;
}
public synchronized ClassA getValues(){
return classA;
}
}