Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does C# have an Override keyword?
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00650689
Message ID:
00650725
Views:
29
I think is has to do with C# being strongly typed. I am sure a virtual method is handled differently than a normal method. In C# you can also specify a method MUST be overridden too.

As to WHY does the language have this, I would say, because that's how it is designed. As you say VFP's OOP implementation is different than C#, but that doesn't make either 'wrong'.

>C# has an Override keyword. Its job is to indentify that the method being redefined in the sub-class exists as a Virtual method in a super class (base class). Virtual is another keyword in C#. In essense, is a Virtual method analogous to a C++ Virtual method which declares functionality without the implementation?
>
>If this is so, the difference in C# is that it enables implementation in the Virtual method. Therefore, the only purpose of the C# Virtual method is to tell C# that the sub class should use the Override method and not the Virtual method.
>
>In VFP, there is no need of declaration. The method can be directly over ridden by implementing the method in the sub class (Override). Then, if we need the base methods (Virtual) functionality then we call DoDefault(). The C# process seems verbose.
>
>Is this methodology used so that documentation of Super-Sub Class relationships are easier for Visio or Designer to uncover?
>
>
>Navneet
Previous
Reply
Map
View

Click here to load this message in the networking platform