0
Inheritance is the ability of a class to inherit the attributes and methods of another class.
example
class A {
public int sum(int a, int b){
return a + b;
}
class B extends A {
int i = 2;
public static void main (String[] args){
B obj = new B();
int c = obj.sum(1,2);
}
}
Inheritance allows for reuseablity of code in your program



