Click here to Skip to main content
16,019,349 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
Hello Team,

I am migrating myself into VB.NET from VB. While I was working with Inheritance, I stucked up with an issue. I have created a Master and Derived classes. I used a function with same signature in both master and derived classes. As per the standards, the base class method should be prefixed with OVERRIDABLE and the derived class method should be prefixed with OVERRIDES. Even if I am not doing this my program is still working. However, VB.NET is showing a warning but not interuppting the program run. What is the reason behind this?

Later when I derived another sub class from the existing dervied class, VB.NET shows error that the method signatures should have OVERRIDABLE & OVERRIDES.

Could someone explain this phenomenon?

Thanks in advance.
Krishna.
Posted

1 solution

If you dont use OVERRIDES, you are still using this method as a new method.
Putting the Shadows keyword in-front of the method will remove the error.

Your sub-class does not contain an Overriable method so you get the error.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900