CAN WE HAVE "VIRTUAL CONSTRUCTORS"?

Amit Singh

Total Post:565

Points:2825
Posted by  Amit Singh
OOPS 
 2067  View(s)
Ratings:
Rate this:
  1. Amit Singh

    Post:565

    Points:2825
    Can we have "Virtual Constructors"?

    constructor cannot be virtual.

    Reason
    :A virtual call is a mechanism to get work done given partial information. In particular virtual allows us to call a function knowing only an interfaces and not the exact type of the object. To create an object you need complete information. In particular you need to know the exact type of what you want to create.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!