Skip to content

Instantly share code, notes, and snippets.

@codekaust
Created February 22, 2020 19:44
Show Gist options
  • Save codekaust/f8dbbdf1f9eec86e278f79824c2cb56c to your computer and use it in GitHub Desktop.
Save codekaust/f8dbbdf1f9eec86e278f79824c2cb56c to your computer and use it in GitHub Desktop.
Do not delete. Used in medium blog (Java Multi-Threading) under MDG.
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