Re: changing access modifier of base method
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Tue, 22 Jan 2008 23:54:22 -0800
On Tue, 22 Jan 2008 23:30:58 -0800, Jon Skeet [C# MVP] <skeet@xxxxxxxxx> wrote:
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.
Ah, right.
I keep getting tripped up by "final" in Java. Maybe it's just me, but the exact meaning of the keyword seems to vary quite a bit according to context. It seems to be usable in places where I don't expect the thing to even possibly be virtual, so I forget that it's used to "un-virtual" something. :)
Anyway, sorry for the error. It is true that by default, methods are virtual and so are overridable. I've seen very few instances of "final" methods, though no doubt they exist in select places.
Pete
.
- Follow-Ups:
- Re: changing access modifier of base method
- From: Jon Skeet [C# MVP]
- Re: changing access modifier of base method
- References:
- changing access modifier of base method
- From: jonpb
- Re: changing access modifier of base method
- From: Fredo
- Re: changing access modifier of base method
- From: jonpb
- Re: changing access modifier of base method
- From: Peter Duniho
- Re: changing access modifier of base method
- From: Jon Skeet [C# MVP]
- changing access modifier of base method
- Prev by Date: Re: User-Agent problem
- Next by Date: Re: Invoke 'Save As' Dialog to save WebBrowser control contents
- Previous by thread: Re: changing access modifier of base method
- Next by thread: Re: changing access modifier of base method
- Index(es):
Relevant Pages
|