摘要: 一、实现多线程 多线程就是在同一时间做多件事情。 有3种方法实现多线程 一、实现Runnable接口 定义一个Hero类,有name,hp,damage属性,和一个attack行为 实现Runnable接口,接口中有个抽象的run()方法 二、继承Thread(其实Thread也是实现的Runnab 阅读全文
posted @ 2019-05-09 16:05 奥兔man 阅读(289) 评论(0) 推荐(0) 编辑