why can't you declare new as overridable?

  • Thread starter Thread starter steve kain
  • Start date Start date
S

steve kain

Hi.

I'm just wondering how come the compiler complains when
you declare a new sub as overridable but it then lets you
define multiple new subs with different interfaces,
essentially overriding each other.

For example, this doesn't work:

public overridable sub new()
end sub

public overrides sub new(byval x as string)
end sub

But this does:

public sub new()
end sub

public sub new(byval x as string)
end sub

Obviously, I can still do what I need to do, but I'd like
to understand why this is so.

Thanks,

skain
 
Hello,

steve kain said:
I'm just wondering how come the compiler complains when
you declare a new sub as overridable but it then lets you
define multiple new subs with different interfaces,
essentially overriding each other.

This doesn't make sense because constructors are not inherited.

Regards,
Herfried K. Wagner
 
Back
Top