class A{
int i,j;
A(int i, int j){
this.i = i;
this.j = j;
}
void show(){
System.out.println("i & j is: " + i + " "+ j);
}
}
class B extends A{
int k;
B(int i,int j, int k){
super(i,j);
this.k=k;
}
void show(){
super.show();
System.out.println("k is: " + k);
}
}
public class Main{
public static void main(String args[]){
B subob = new B(1,2,3);
subob.show();
}
}
Method Overriding_02
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment