Hi, I'm new to Java, getting compiler error for the following code:
class A {
int x;
A (int a) {System.out.println ("class A");}
}
class B extends A{
int x;
B() {System.out.println ("class B");}
public static void main (String[] args) {
A a= new B();
}
}
The compiler error I get is:
A(int) in A cannot be applied to ()
B() {System.out.println ("class B");}
^
Can somebody tell me how to fix it in class B?