Article View: borland.public.jbuilder.java.api
Article #3020Re: Why are methods final?
From: John P. McGrath
Date: Mon, 25 May 1998 00:00
Date: Mon, 25 May 1998 00:00
15 lines
1015 bytes
1015 bytes
bill <bwinspur@xsite.net> wrote in article <3549CE7D.1BA40EB4@xsite.net>... > I wanted to subclass java.util.Vector so that my vector would throw > events when an element was inserted or deleted. Not easily done. The > insert and remove methods in Vector are final and cant be overridden. > I'll find a workaround, but why are the above methods defined as final ? I'm sure it was done for efficiency. Making methods final allows the compiler to perform optimizations that it could not otherwise make. -- John P. McGrath <mcgrath@enter.net> <jpm@nscs.fast.net>
Technical Details
Message-ID:
<01bd87b5$185b2a20$0e47aacc@ferd>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3549CE7D.1BA40EB4@xsite.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,bf5509b9ebccfe15 X-Google-Attributes: gid1089d0,public From: "John P. McGrath" <mcgrath@enter.net> Subject: Re: Why are methods final? Date: 1998/05/25 Message-ID: <01bd87b5$185b2a20$0e47aacc@ferd> X-Deja-AN: 356265296 References: <3549CE7D.1BA40EB4@xsite.net> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.api