When u declare a static field, there is only one value of the field for all objects, when u declare a non-static instance, every object has its own copy of this variable.. If u declare static filed to hold a ThreadLocal, it can holds a different value for each thread. Objects running in the same thread can get the identical value by calling get() while those running in different threads get different value..
This post has been archived. It cannot be replied.