Created
February 22, 2020 19:44
-
-
Save codekaust/f8dbbdf1f9eec86e278f79824c2cb56c to your computer and use it in GitHub Desktop.
Do not delete. Used in medium blog (Java Multi-Threading) under MDG.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ThreadUsingRunnableInterface{ | |
public static void main(String[] args) { | |
Thread t2 = new Thread( | |
()-> { | |
System.out.println("Thread name: "+ Thread.currentThread().getName()); | |
System.out.println("Thread id: "+ Thread.currentThread().getId()); | |
}, "Example_thread"); | |
t2.start(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment