What will be the output of the following program code?
publicclassSuperdenmo
{
publicstaticvoid main(String[] args)
{
B b=new B();
b.add();
b.display();
}
}
class A
{
intx,y;
A()
{
x=10;
y=20;
}
}
class B extends A
{
intx,y,a,b;
B()
{
x=100;
y=200;
}
void add()
{
a=x+super.x;
b=y+super.y;
}
void display()
{
System.out.print(“value of a=”+a+nvalue of b=+b);
}
}
Reveal answer
Fill a bubble to check yourself