Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subclass final class (Boolean) ?



On 27-Aug-06, at 11:06 AM, Ken Anderson wrote:

The idea is that other (existing) code can rely on the behaviour of the 'final'ized class. E.g. since Boolean is final, other code can rely on the fact that trueObj.toString() is "true", for example.

Then why not make the toString() method final instead of the entire class?

I mentioned toString() just as an example. The idea is that other code can rely on *everything* about the Boolean class - it is a fully specified and known quantity. This is important for security in some cases. It also allows for some performance optimizations.


--
Cameron Hayne
email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Subclass final class (Boolean) ? (From: Ken Anderson <email@hidden>)
 >Re: Subclass final class (Boolean) ? (From: Cameron Hayne <email@hidden>)
 >Re: Subclass final class (Boolean) ? (From: Ken Anderson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.