Runnable : 리턴 X, Exception X
Callable : 리턴 O, Exception O
public interface Runnable {
public abstract void run();
}
Thread thread = new Thread(Runnable);
Thread thread = new Thread(() -> System.out.println("Runnable thread"));
thread.start();
public interface Callable<V> {
V call() throws Exception;
}
Callable 사용 예는 Executor 포스팅에서 같이 다루겠다.