top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is a thread local variable in Java?

0 votes
629 views
What is a thread local variable in Java?
posted Oct 14, 2016 by Ahana

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
 
Best answer

The documentation says it very well: "each thread that accesses [a thread-local variable] (via its get or set method) has its own, independently initialized copy of the variable". You use one when each thread must have its own copy of something. By default, data is shared between threads.

answer Oct 14, 2016 by Joy Nelson
...