Whenever we are writing logic for constructor of a class, the first statement in that code block should call a constructor of base class. If not we will get following error –
First statement of this 'Sub New' must be a call to 'MyBase.New' or 'MyClass.New' because base class 'base class name' of 'class name' does not have an accessible 'Sub New' that can be called with no arguments.
This is wrong and will give above error message.
The logic can be corrected by calling base constructor as first statement –
Note that the base constructor call is the first statement and you have all the logic implemented in it.
You can even write your logic in a shared/static method and call from first statement as follows:
While writing constructor, if no base class constructor is explicitly called, then the default constructor of base class (constructor without arguments) will be called.
If base class lacks default constructor, then writing child class without explicitly calling base class constructor will cause the error mentioned