Created
June 4, 2015 15:22
-
-
Save canimus/acab319552a32d3f3681 to your computer and use it in GitHub Desktop.
thread.java
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 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