Thread.currentThread()
is a static method which provides reference to currently executing Thread (basically a reference to 'this' thread).
Accessing non-static members (especially this
) inside a static method is not possible in Java, so currentThread()
is a native method.
How does currentThread()
method work behind the scenes?