why constructor cannot be virtual in system Verilog ?
In reply to charmi Shah:
Hi,
If you make constructor as virtual, you are not building your base class and directly building your extended class which is not possible… Always extended class comes into existence from base class, Without building base class, you cannot build extended class.
How “virtual” works?
Suppose you are calling any method which is virtual in your base class, with your base class handle. At the runtime , it will decide which method method to call based on what type of “object” that base type handle points to.
Objects are created by calling constructor. Before constructor call, no objects exists then How will “virtual” work?? thats why constructor can not be virtual.