Skip to content

Instantly share code, notes, and snippets.

@sne007
Last active September 23, 2020 06:12
Show Gist options
  • Save sne007/cca357f2027359b93106eb5d93dd47cf to your computer and use it in GitHub Desktop.
Save sne007/cca357f2027359b93106eb5d93dd47cf to your computer and use it in GitHub Desktop.
class ThreadForT1 extends Thread{
public void run() {
System.out.println("Thread for T1 is running in thread " + Thread.currentThread().getName());
}
public static void main(String[] args) {
ThreadForT1 t = new ThreadForT1();
t.run();
}
}
// Output: Thread for T1 is running in thread main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment