TestRunnable实现Runnable接口
作者:
勇者与王者 | 来源:发表于
2019-10-10 19:04 被阅读0次package multiThread;
/**
*
* @author qz:
* @version 创建时间:2019年10月10日 上午10:04:11
*
*/
public class TestRunnable {
public static void main(String[] args) {
// TODO Auto-generated method stub
Hero gareen = new Hero();
gareen.name = "盖伦";
gareen.hp = 616;
gareen.damage = 50;
Hero teemo = new Hero();
teemo.name = "提莫";
teemo.hp = 300;
teemo.damage = 30;
Hero bh = new Hero();
bh.name = "赏金猎人";
bh.hp= 500;
bh.damage = 65;
Hero leesin = new Hero();
leesin.name = "李青";
leesin.hp = 455;
leesin.damage = 80;
Battle bt = new Battle(gareen, teemo);
new Thread(bt).start();
Battle bt2 = new Battle(bh, leesin);
new Thread(bt2).start();
}
}
本文标题:TestRunnable实现Runnable接口
本文链接:https://www.haomeiwen.com/subject/rlwapctx.html
网友评论