posted 22 years ago
Could someone please help me out with this, its a modification of a question I came across in Jxam:
This code as is, compiles correctly, but when the super(k) call is removed, it gives a compile time error : No constructor in matching Parent() in class Parent
Child(int k{
I know that child class construtors make an implicit call to the superclass's 'no-args' constructor and thats why the error.
If you remove the child class altogether, the code compiles correctly. My query is that in the main method the code is Parent p = new Parent(6).....so why are the child-class constructors-calls, in the picture at all. Should'nt the output just be .....This is the Parent Constructor 6....
Help!!!
Rebecca