TestThread
作者:
勇者与王者 | 来源:发表于
2019-10-10 19:02 被阅读0次package multiThread;
/**
*
* @author qz:
* @version 创建时间:2019年10月9日 下午5:04:46
*
*/
public class TestThread {
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;
//盖伦攻击提莫
while(!teemo.isDead()){
gareen.attackHero(teemo);
}
//赏金猎人攻击盲僧
while(!leesin.isDead()){
bh.attackHero(leesin);
}
}
}
本文标题:TestThread
本文链接:https://www.haomeiwen.com/subject/hhwapctx.html
网友评论