Thread and Runnable

How to create a Thread 1. extends Thread implement run() start() 2. implements Runnable //since 1.8 Runnable is functional implement run() new Thread(new Runnable) start() 3. since 1.5 – java.util.concurrent.Callable simple as Runnable, can return value Threads features anotherVenus.join(); – waits for thread Thread.sleep(ms) – any others threads can interrupt it wait() notify() notifyAll() Timer TimerTask java.util.concurrent.Future […]