Re: changing access modifier of base method



Peter Duniho <NpOeStPeAdM@xxxxxxxxxxxxxxxx> wrote:

<snip>

Now, for what it's worth, there are OOP environments in which you have a
little more control. You still can't hide a method, but you can ensure
that your code always gets called, because the language has _only_ virtual
methods. For example, Java.

No, Java has non-virtual methods too - you use the "final" modifier to
seal a method. It's just that unfortunately Java's methods are virtual
by default.

(I think C# classes ought to be sealed by default as well, but that's a
whole other discussion...)

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
.



Relevant Pages


Loading