小凡156

博客园 首页 新随笔 联系 订阅 管理

2019年10月31日 #

摘要: /* What will be run. */ private Runnable target; 如果线程在创建时传入了Runnable运行对象,那么该对象的run方法将被调用 1 /** 2 * If this thread was constructed using a separate 3 * <code>Runnable</code> run object, then that 4 * < 阅读全文
posted @ 2019-10-31 22:42 小凡156 阅读(363) 评论(0) 推荐(0) 编辑

摘要: 总结: 1. 要通过thread来执行的类实例,并且不需要重写除了run()以外其它thread方法,则应使用runnable接口2. 实现runnable接口必须定义一个没有参数的run方法,run方法中可以做任何操作 阅读全文
posted @ 2019-10-31 20:30 小凡156 阅读(250) 评论(0) 推荐(0) 编辑