Inheritance Programs1
Inheritance Programs1
public class A{
protected int x;
public A(int x){
this.x=x;
}
}
Hierarchical Inheritance:
Binding:
* Process of replacing a function call with function body
Compile-time binding -> method body is replace the function during compile time
Run-time binding -> method body is selected during run-time
public class A{
int x;
A(){
this.x=0;
}
A(int x){
this.x=x;
}
}