Skip to content

Instantly share code, notes, and snippets.

@happydeveloper
Created October 10, 2013 13:50
Show Gist options
  • Save happydeveloper/6918680 to your computer and use it in GitHub Desktop.
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
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