Hi Niranjan, Every super class must have the constructor whether it is abstaract or non-abstract hence whenever instance of derived class get created before calling it's const. super class const get called. Now just try to corelect this concept with u r scenario will get the clerification.
Joined: Aug 13, 2005
How is it possible,to create the object of super class which is an abstract class,becoz super class's constructor is being called?
You cannot directly instatiate an abstract class, but you can instatiate it through a concrete class which extends your abstract class. Your abstract class becomes a part (means methods & attributes defined in your abstract class) of your concrete class instance.
Hey hey...u never instanctiate the abstract class,u just initialize the members of abstract class which gets inherited into derived class and in this case u can't say u have a instance of abstract class hence the memory allocation is for derived class and not for super...............!
Sachin Dimble, JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.
I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.