Willem Odendaal

the coder's point of view

<November 2008>
SuMoTuWeThFrSa
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456


Navigation

I Read

Subscriptions

Post Categories



Wednesday, March 17, 2004 - Posts

Sealed Methods

I read an article on C# Help, regarding sealed methods. I find it rather strange that one cannot seal a base class method (only a method that's been overridden from a base class).

ie.
public sealead string GetResults() {...} //Won't work

public override sealed string GetResults() {...} //Will work.

I'm sure the .Net guys have a good reason for doing this. I just wonder why.

Update: Ouch, I forgot that a method that can be overidden HAS to be declared as virtual(or something similar) in the base class. Is it possible that I haven't created my own Base class with overridable members in such a long time? Scary.

posted Wednesday, March 17, 2004 11:28 PM by willemo




Powered by Dot Net Junkies, by Telligent Systems