Actually, the reason is immutability. If Boolean weren't final, you
could do modify it as a parameter, so for example:
Boolean b = new Boolean(true);
someMethod.futzAbout(b);
//b can now be true or false
This is undesirable, especially as Boolean and friends are wrappers
for their primitive versions, which due to pass by value are also
'immutable' in the same way.
On Aug 27, 2006, at 11:02 AM, Cameron Hayne wrote:
On 27-Aug-06, at 10:28 AM, Ken Anderson wrote:
OK, I'm a little annoyed here because I find the whole concept of
'final' to be ridiculous.
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.
--
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
_______________________________________________
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