Hey ppl.
A little Q.
When I have my class inherit from another class and instantiate an instance of it, will the baseclass constructor be called automaticly? And if so, before or after the subclass constructor?
If not, can I force a call to it with Super.New() ?
Example:
I'd expect the output to be either of the following.
Possibility A - BAse constructor is ignored.
Possibility B - Base constructor is called first
Possibility C - Sub constructor is called first
In the case of Possibility A, can I do the following to force a call to the Base constructor?
A little Q.
When I have my class inherit from another class and instantiate an instance of it, will the baseclass constructor be called automaticly? And if so, before or after the subclass constructor?
If not, can I force a call to it with Super.New() ?
Example:
Type Base Method New() Print( "Base class Constructor called" ) End Method End Type Type Sub Extends Base Method New() Print( "Sub class Constructor called" ) End Method End Type s:Sub = New Sub
I'd expect the output to be either of the following.
Possibility A - BAse constructor is ignored.
Sub class Constructor called
Possibility B - Base constructor is called first
Base class Constructor called Sub class Constructor called
Possibility C - Sub constructor is called first
Sub class Constructor called Base class Constructor called
In the case of Possibility A, can I do the following to force a call to the Base constructor?
Method New() Print( "Sub class Constructor called" ) Super.New() End Method