Your Ad Here

Monday, March 9, 2009

polymorphism and mimicing Java's Object

As far as I know, there is not a "godfather" class Object in c++ like there is in java. Would it be bad to define such a class, leave it empty and make classes inherit from it.

Mostly for writing a class to handle linked lists once and only once and defining the pointers as

Code:
---------
Object data = new *derived class here*
---------
Polymorphism would handle the rest, but wouldn't that be considered late binding and would it come with a performance toll?

Read More...
Your Ad Here

No comments: