oop - Is it possible to override a constructor in C#? -


is possible override constructor of base class in derived class?

if so, how can accomplished , in use case practical? if not, why not?

no, can't override constructors. concept makes no sense in c#, because constructors aren't invoked polymorphically. state class you're trying construct, , arguments constructor.

constructors aren't inherited @ - constructors derived class must chain either constructor in same class, or 1 of constructors in base class. if don't explicitly, compiler implicitly chains parameterless constructor of base class (and error occurs if constructor doesn't exist or inaccessible).


Comments

Popular posts from this blog

All overlapping substrings matching a java regex -

c++ - Using OpenSSL in a multi-threaded application -

php - Deleting/Renaming a locked file -