class threadTest implements Runnable { public void run() { //要做的事寫在這邊 } };
Thread thread = new Thread(new threadTest()); thread.start();
if (thread != null) { thread.interrupt(); thread = null; }
沒有留言:
張貼留言