Y
ypjofficial
Hello All,
I have following doubt..
class abstractclass
{
public:
abstractclass(){}
virtual void method()=0;
};
class concreteclassublic abstractclass
{
public:
concreteclass(){}
void method(){}
};
void main()
{
concreteclass c;
}
now when I create the object of concreteclass, the constructor of
abstractclass will be called.and as per the logic constructors are
called while creating the object,object of abstractclass is being
created..so how come we can create an object of a abstract class?
or to put in another way is there any paradox when the constructor of
an abstract class gets called?
Thanks and Regards,
Yogesh Joshi
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
I have following doubt..
class abstractclass
{
public:
abstractclass(){}
virtual void method()=0;
};
class concreteclassublic abstractclass
{
public:
concreteclass(){}
void method(){}
};
void main()
{
concreteclass c;
}
now when I create the object of concreteclass, the constructor of
abstractclass will be called.and as per the logic constructors are
called while creating the object,object of abstractclass is being
created..so how come we can create an object of a abstract class?
or to put in another way is there any paradox when the constructor of
an abstract class gets called?
Thanks and Regards,
Yogesh Joshi
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]