I have a question Singleton pattern and threads. Implementation is like this.
public class Singleton { private static final Singleton instance = new Singleton(); private SomeClass someField; // and another private fields private Singleton() { someField = new SomeClass(some args); // init another private fields } public Singleton getInstance() { return instance; } public void operation() { //some operations someField.method(); }}
(Sorry I can not provide real example.)The question is next: is method operation() thread safe?