Hey Guys,
I have the following code:
class A
{
int a,b;
A(int i,int j)
{
a=i;
b=j;
}
void showab()
{
System.out.println(a+" and "+b);
}
}
class B extends A
{
int k=20;
void showabk()
{
System.out.println("a="+a);
System.out.println("b="+b);
System.out.println("k="+k);
}
}
class Test
{
public static void main(String args[])
{
A obj1=new A(15,30);
B obj2=new B();
obj1.showab();
obj2.showabk();
}
}
When I compile the above code, I get the following error:
"Cannot Find Symbol Constructor A()"
What is the reason for this error and what is the solution to it.