Write a Java program to demonstrate single inheritance.
class AA {
int i;
void showI() {
System.out.println("i = "+i);
}
}
class BB extends AA {
int j;
void showJ() {
System.out.println("j = "+j);
}
}
public class SingleInhDemo {
public static void main(String[] args) {
AA a = new AA();
BB b = new BB();
a.i = 56;
b.j = 23;
a.showI();
b.showJ();
}
}
i = 56
j = 23