美文网首页
ThreadDemo1

ThreadDemo1

作者: 勇者与王者 | 来源:发表于2019-10-10 19:03 被阅读0次
    package multiThread;
    /**
    * 
    * @author q06285:
    * @version 创建时间:2019年10月10日 上午9:48:03
    * 
    */
    public class ThreadDemo1 {
    
        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;
            
            KillThread killThread1 = new KillThread(gareen, teemo);
            killThread1.start();
            KillThread killThread2 = new KillThread(bh, leesin);
            
            killThread2.start();
        }
    }
    

    相关文章

      网友评论

          本文标题:ThreadDemo1

          本文链接:https://www.haomeiwen.com/subject/qkwapctx.html