If you declare a member variable as volatile in Java, does this mean that all the object\'s data is stored in volatile memory, or that the reference to the object is stored in v
private volatile C obj;
That will make only obj volatile.
obj
Does it make obj.c and obj.i thread safe or not?
No. To make them thread-safe, you have to synchronize the access to them.