Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.posted.palinacquisition!news.posted.palinacquisition.POSTED!not-for-mail NNTP-Posting-Date: Tue, 06 Sep 2011 23:38:56 -0500 Date: Tue, 06 Sep 2011 21:38:56 -0700 From: Peter Duniho User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.21) Gecko/20110830 Thunderbird/3.1.13 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Avoid derived class to override a method yet should allow callers to invoke the method References: <79cc1af8-1f3c-41c7-bbe2-8c5085b25e7c@t9g2000yqi.googlegroups.com> In-Reply-To: <79cc1af8-1f3c-41c7-bbe2-8c5085b25e7c@t9g2000yqi.googlegroups.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <8OydneypBoL9aPvTnZ2dnUVZ_rednZ2d@posted.palinacquisition> Lines: 12 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 50.46.118.188 X-Trace: sv3-HyRw7+lYpKRhjnNBAdPyYVpvyndkIMGMpL33j0gKL2W0HCv/PuVTuWgvcGSvgWTNFBmcvZd1EY1xxGk!0rvzyAL4YfaH7GDqor3RnyzE9Hcc+25PW9743yo+COC5WiYje1D/WOfu5AGC7tiNESHQfNcAxEQb!UqegOmwoenXCSsHRl1RkVsm9p/XruZM1HCOSZOkxIK4= X-Complaints-To: abuse@iinet.com X-DMCA-Complaints-To: abuse@iinet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1814 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7664 On 9/6/11 9:05 PM, Ethan wrote: > Hello, > > I have a requirement where base class has method (implemented) and > derived class shouldn't be able to override it. > However, the method needs to be invoked by a caller who creates an > instance of the derived class. > > Is this possible? Can you explain why simply marking the method "public final" does not suffice for your needs?