9-Encapsulation and Abstraction
9-Encapsulation and Abstraction
9-Encapsulation and Abstraction
Abstraction
Abstraction
Encapsulation
?
10 © 2012 WIPRO LTD | WWW.WIPRO.COM | CONFIDENTIAL
Class Declaration for Point - modified
class Point{
private int x;
private int y;
public void setX( int x){
this.x= (x > 79 ? 79 : (x < 0 ? 0 :x));
}
public void setY (int y){
this.y= (y > 24 ? 24 : (y < 0 ? 0 : y));
}
public int getX( ){
return x;
}
public int getY( ){
return y;
}
}