It is giving compilation error as can not find symbol Base() In Base class�.. Here I am calling long parameterized constructor in Test2l class only.. But why this error? Can anyone explain me?
In any derived class if you have a constructor it MUST explicitly call some constructor of the parent class. If you do not specify then it looks for the default constructor of the Base class. In your case the default constructor of the Test2 class does not explicitly call the parameterized constructor of the Base class. Thus the compiler searches for the default which it cannot find and thus the error. Try removing the default constructor or alternatively calling the parameterized constructor from the default. It will work