Public Sub New() not inheriting?

N

Nemisis

Hi everyone,

Can someone tell me why, if i have a Base class (classA) that have a
constructor of

Public Sub New()

End Sub

And i have a class that inherits the functionality of this class
(ClassB), why does ClassB not have the New constructor??

Do i have to explictly define this in every class that inherits ClassA??
 
T

tdavisjr

If you don't define a constructor, the CLR will define one for you. All
classes MUST have a constructor. So, ClassB will be given a constructor if
you don't explictly write one yourself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top