why constructor cannt be declar virtually?
why destructor cannt be overloaded?
Answers were Sorted based on User's Feedback
Answer / subhashish sen
Constructor can't be virtual,becoz constructor is an entity
which initializes V-table(V-table contains addrress of all
the virtual functions of class).So if we declare constructor
as virtual the who will intialize V-table for this constructor.
Destructor can not be overloaded simply becoz we cant
provide argument to a destructor and also its going to
release the memory when an object goes out of scope.
| Is This Answer Correct ? | 20 Yes | 0 No |
Answer / saurabh
destructors ae not overloaded as its mere function is to
release memory ,and the objects which are going to die
soon...and u r looking for other ways to kill those objects.
| Is This Answer Correct ? | 1 Yes | 8 No |
what is the difference between ERROR and EXCEPTION?
What is pointer in oop?
How long to learn object oriented programming?
What is difference between class and object with example?
hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.
What is class and object with example?
What is the difference between encapsulation and polymorphism?
What is the example of polymorphism?
How do you define a class in oop?
why in java first invoke public static void main(String args[]) method????Why not public static void method1(String args[])??
Can private class be inherited?
Can anyone please explain runtime polymorphism with a real time example??at what ciscumstances we go for it??