Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » J2EE Pattern »

Re: Is Singleton thread safe?

Garima Bathla

2005-04-05

Replies:

As far as I understand -
 
Declaring a class FINAL means that class designer does not wants this class to be extendible, so this class cannot provide any additional functionality.
 
Desiging a class Singleton indicates that at any instant of time there will be only one instance (one object) of this class.
 
So by making a Singleton class Final -> means that there will be only one instance of this class which cannot be extended for adding new functionality.
 
I wonder why will be a class declared FINAL if it has to be extended in functionality by other classes?
 
Singleton and FINAL ar 2 different concept all together.
 
 
Regards,
Garima.
 

 
On Apr 5, 2005 5:23 AM, Julia Liu <julialiu@yahoo.com> wrote:
If I declare Singleton class as final, How could I add new functioality
to the class?  Thanks.

 


Julia  Liu 

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com ==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@java.sun.com


==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@java.sun.com
©2008 junlu.com - Jax Systems, LLC, U.S.A.