Created
October 10, 2013 13:50
-
-
Save happydeveloper/6918680 to your computer and use it in GitHub Desktop.
Runnable 객체는 Thread 생성자에게 넘겨준다.
The Runnable object is passed to the Thread constructor
API 참조 http://docs.oracle.com/javase/tutorial/essential/concurrency/runthread.html
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
package docs.oracle.com.Thread; | |
public class HelloRunnable implements Runnable { | |
@Override | |
public void run() { | |
// TODO Auto-generated method stub | |
System.out.println("Hello from a thread!"); | |
} | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
(new Thread(new HelloRunnable())).start(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment