It's not a secret anymore!
The moose likes Beginning Java and the fly likes SingleTon class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "SingleTon class " Watch "SingleTon class " New topic

SingleTon class

h kumar

Joined: Jul 03, 2007
Posts: 13
HI All,

Can any one give answer for this question...

how can you make singleton class as threadsafe ?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14998

Before you post a question, please take a moment to think in which forum you can post it best: carefully choose one forum.

This question does not have anything to do with Tomcat - I will move it to a more appropriate forum.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
bart zagers
Ranch Hand

Joined: Feb 05, 2003
Posts: 234
This is actually a Javaranch FAQ question (also read the linked newsletter entry).
Krithika Srinath
Ranch Hand

Joined: Apr 11, 2006
Posts: 52
take a look at this faq.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24193

Originally posted by Krithika Srinath:
take a look at this faq.


No, don't take a look at that FAQ. It shows the (discredited) "double-checked locking" technique. It's wrong and not thread-safe.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: SingleTon class
It's not a secret anymore!