class A{
int x;
public A(){
this.print() ;
}
public void print(){
System.out.println("x = " + x) ;
}
};
class B extends A{
int x = 100 ;
public B(int x){
super();
this.x = x ;
}
public void print(){
System.out.println("x = " + x) ;
}
};
public class TestJava{
public static void main(String args[]){
B a = new B(10) ;
}
};
|
|