class superclass{
Integer x;
public
void setx(int x){
this.x=x;
}
public Integer getx(){
return
x;
}
}
class subclass extends superclass{
Integer y;
public
void sety(int y){
this.y=y;
}
public Integer gety(){
return
y;
}
}
public
class First {
public
static
void main(String args[]){
superclass a;
subclass b=new subclass();
b.setx(10);
b.sety(20);
a=b; // sub class to super class , only members of superclass in subclass will to super class
System.out.println(b.getx()+" "+a.getx());
a.setx(100);
//b=a;
/
}
}
Is Tamanna dominating Trisha ?
15 years ago