Instantiating a class, then using it in another thread
问题 Consider two threads: threadA and threadB . (E.g. let threadA be the UI thread, and let threadB an own subclass of Thread .) Regarding data visibility , is it safe to instantiate a class in threadA , pass it to the constructor of threadB , and then use it exclusively from threadB ? Let me clarify this with code. (Note that the code is simplified, so this architecture makes sense in the real application in its actual form.) public class SomeClass { public SomeClass(....) { // initialization }