+ 2
While invoking sub class usin constructor how the super class gets executing first?
6 odpowiedzi
+ 2
A.G.RAGHUL , I am not aware about Java much but this is common concept of Oops.
it's build like that way.. reason is that super class members are inherited in sub class.. constructor of sub class initialise sub class members... so, to initiate super class member available in sub class, constructor of super class gets executed
+ 1
Specify the language please.
+ 1
java
+ 1
but while calling sub class function through object the base class function is not called
+ 1
it's not called but they are available to you if you wish... constructor allocates memory and initialise member variables (not functions) by getting called before sub class constructor
+ 1
👍