Question: Consider the following class:

```
public class MyClass
{
    private MyObject obj;

    public MyClass()
    {
        obj = new MyObject();
    }

    public void methodCalledByOtherThreads()
    {
        obj.doStuff();
    }
}

```

Since obj was created on one thread and accessed from another, could obj be null when methodCalledByOtherThread is called? If so, would declaring obj as volatile be the best way to fix this issue? Would declaring obj as final make any difference?

Edit:
For clarity, I think my main question is:
Can other threads see that obj has been initialized by some main thread or could obj be stale (null)?

Answer: 
For the `methodCalledByOtherThreads` to be called by another thread and cause problems, that thread would have to get a reference to a `MyClass` object whose `obj` field is not initialized, ie. where the constructor has not yet returned.

This would be possible if you leaked the `this` reference from the constructor. For example

```
public MyClass()
{
    SomeClass.leak(this); 
    obj = new MyObject();
}

```

If the `SomeClass.leak()` method starts a separate thread that calls `methodCalledByOtherThreads()` on the `this` reference, then you would have problems, but this is true regardless of the `volatile`.

Since you don't have what I'm describing above, your code is fine.
Your other thread **could** see a null object. A volatile object could possibly help, but an explicit lock mechanism (or a Builder) would likely be a better solution.

Have a look at [Java Concurrency in Practice - Sample 14.12](https://stackoverflow.com/questions/10528572/java-concurrency-in-practice-sample-14-12)