????????????????
?????????????????μ?????
??????? Runnable ????Runnable ?????????????????run??run ?????е????????????????????С?????? Runnable ?????????? Thread ?????????????
????<code class="java">public class HelloRunnable implements Runnable {
????public void run() {
????System.out.println("Hello from a thread!");
????}
????public static void main(String args[]) {
????(new Thread(new HelloRunnable())).start();
????}
????}</code>
??????? Thread??Thread ??????? Runnable ???????????? run ???????????С????????????? Thread??????д run ??????
????<code class="java">public class HelloThread extends Thread {
????public void run() {
????System.out.println("Hello from a thread!");
????}
????public static void main(String args[]) {
????(new HelloThread()).start();
????}
????}</code>
?????????????????????? Thread.start ?????????μ????
???????????????????????
??????? Runnable ???????????????????????
??????? Runnable ???????????????????????????????? Thread????????
???????????Щ?????????? APIs
??????? Thread????????????????????????????????????? ??java??
????????????????