📅  最后修改于: 2020-11-15 03:10:16             🧑  作者: Mango
java.lang.ThreadLocal类提供线程局部变量。
以下是java.lang.ThreadLocal类的声明-
public class ThreadLocal
extends Object
Sr.No. | Constructor & Description |
---|---|
1 |
ThreadLocal() This creates a thread local variable. |
Sr.No. | Method & Description |
---|---|
1 | T get()
This method returns the value in the current thread’s copy of this thread-local variable. |
2 | protected T initialValue()
This method returns the current thread’s “initial value” for this thread-local variable. |
3 | void remove()
This method removes the current thread’s value for this thread-local variable. |
4 | void set(T value)
This method sets the current thread’s copy of this thread-local variable to the specified value. |
此类从以下类继承方法-