How to inherit constructors with arguments in .NET?

Posted by Soumya92 on Stack Overflow See other posts from Stack Overflow or by Soumya92
Published on 2010-03-31T05:42:12Z Indexed on 2010/03/31 6:33 UTC
Read the original article Hit count: 294

Filed under:
|
|

I have a "MustInherit" .NET class which declares a constructor with an integer parameter. However, Visual Studio gives me an error when I create any derived class stating that there is no constructor that can be called without any arguments. Is it possible to inherit the constructor with arguments?

Right now, I have to use

Public Sub New(ByVal A As Integer)
    MyBase.New(A)
End Sub

in the derived classes. Is there any way to avoid this?

© Stack Overflow or respective owner

Related posts about inheritance

Related posts about .NET