I have a question on the following code. Is it possible that the following code can throw Null Pointer Exception?
can the following code produces Null pointer exception?
Since Test class is being added dynamically to ByValue class and Test is a static field in the ByValue, is it possible that when one Thread RESET this static Test field the other thread sees a NULL value?
From Time line point of view, say Thread T3 run() first and instantiate ByValue first and then set Test object to static Test field. But before calling byValue.getTest(), Thread T4 run() and reset a new Test object in the ByValue. Question I have is it possible that T3 can get Null Pointer Exception when it calls byValue.getTest().getName();