正在加载图片...
扩展Thread类创建线程 /Custom thread class /client class oublic class CustomThread extends Thread public class client public CustomThread(.) public someMethod() { /Create a thread CustomThread thread -new CustomThread(.) /Override the run method in Thread public void run() /Start a thread thread.start(); /Tell system how to run custom thread ©2006计算机系杨群 All rights lefts reserved.©2006 计算机系 杨厚群 All rights & lefts reserved. 扩展Thread类创建线程 // Custom thread class public class CustomThread extends Thread { . public CustomThread(.) { . } // Override the run method in Thread public void run() { // Tell system how to run custom thread . } . } // Client class public class Client { . public someMethod() { . // Create a thread CustomThread thread = new CustomThread(.); // Start a thread thread.start(); . } . }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有