- /*
- This Java example shows how to get reference of current thread using
- currentThread method of Java Thread class.
- */
- public class GetCurrentThread {
- public static void main(String[] args) {
- /*
- * To get the reference of currently running thread, use
- * Thread currentThread() method of Thread class.
- *
- * This is a static method.
- */
- Thread currentThread = Thread.currentThread();
- System.out.println(currentThread);
- }
- }
- /*
- Output of the example would be
- Thread[main,5,main]
- */
Monday, September 17, 2012
How to get Current Thread Example
Subscribe to:
Post Comments (Atom)
How TOPT Works: Generating OTPs Without Internet Connection
Introduction Have you ever wondered how authentication apps like RSA Authenticator generate One-Time Passwords (OTPs) without requiring an i...
-
Tabs Ctrl+1-8 – Switch to the specified tab, counting from the left. Ctrl+9 – Switch to the last tab. Ctrl+Tab – Switch to the next...
-
From last one month, My internet device is missing from my terrace. So, Mostly I use mobile to access my mail but accessing mail via mobile...
-
In my previous blog, I have already discussed on Lambda Expression and its Syntax as well as Functional Interface. So, if you are not awa...
No comments:
Post a Comment