Skip to content

Instantly share code, notes, and snippets.

@canimus
Created June 4, 2015 15:22
Show Gist options
  • Save canimus/acab319552a32d3f3681 to your computer and use it in GitHub Desktop.
Save canimus/acab319552a32d3f3681 to your computer and use it in GitHub Desktop.
thread.java
public class ThreadExample {
public static void main(String[] args){
System.out.println(Thread.currentThread().getName());
for(int i=0; i<10; i++){
new Thread("" + i){
public void run(){
System.out.println("Thread: " + getName() + " running");
}
}.start();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment