07 2019 档案

摘要:线程的暂停和恢复:即让线程暂时停止运行,并能恢复 suspend() 暂停线程。为已经过时方法 resume() 恢复暂停的线程。为已经过时的方法 例子 public class SuspendThread extends Thread{ private int i; public int g... 阅读全文
posted @ 2019-07-13 10:29 foreast 阅读(112) 评论(0) 推荐(0) 编辑
摘要:1.线程的创建和启动方式: 1.自定义类,让其继承Thread并重写run()方法,创建此类的对象。调用start()方法启动 public class MyThread extends Thread { //自定义线程类 @Override public void run() { 。。... 阅读全文
posted @ 2019-07-07 18:15 foreast 阅读(168) 评论(0) 推荐(0) 编辑