.net - Can a subclass inherit a constructor? -


  1. I have a base class, "B", in which there are two constructors, no parameters and the second < / Li>
  2. I have a sub-class, "s", which is derived from "b" and does not define any constructor in it.
  3. I make an example of S, trying to pass the constructor closer to the integer.

I get an error:

Error 1 Many arguments for 'Public Sub New' () Code> "

This is a surprise to me because I thought that if a constructor is not defined in the subclass, S, the base class constructor method, in particular, with one integer param a walk / o error. / P>

Do you have any idea why I am getting this error? Are the consignor a special case?

As you suspect, the Constructors are not inherited. To implement subclasses of their own constructor The reason is that the construc torus of the base class will not know how to start sub-class members, so by applying them the subclass object will be kept in bad condition.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -