已采纳回答 / weixin_慕无忌7033199
                                
                                                            Thread是一个类(class),Actor继承类的时候需要用 “extends”;Runnable是一个接口(interface),Actress实现接口的时候用“implements”;
                            
                        
                        2020-09-20
                
            
                                已采纳回答 / 我爱小七
                                
                                                            其实老师的代码如果在双方军队战斗那加上sleep()方法的话,你会发现:程咬金先战斗完之后才是军队执行完因此个人觉得应该在程咬金出厂后加入一个判断,如下所示:<...code...>这样的话才能使得双方军队退场后,程咬金才会上场,才符合逻辑。
                            
                        
                        2019-10-12
                
            
                                已采纳回答 / 精慕门0548516
                                
                                                            Thread thread = new Thread();Thread thread = new Thread(String name);Thread thread =  new Thread(Runnable runnable);Thread thread = new Thread(Runnable runnable, String name);入参name可以通过Thread.currentThread.getName()获得
                            
                        
                        2019-02-28
                
            
                                已采纳回答 / leopoincare
                                
                            
                                                            /**
 * Creates an {@code ArrayBlockingQueue} with the given (fixed)
 * capacity and the specified access policy.
 *
 * @param capacity the capacity of this queue
 * @param fair if {@code true} then queue accesses for...
                        
                        2018-09-08
                
            
                                最赞回答 / 火云邪神的爷爷4298702
                                
                                                            thread.interrupt()方法的作用是唤醒阻塞的线程,并抛出异常。当sleep后,线程阻塞,thread.interrupt()方法执行后,线程又被唤醒并抛出异常。因为线程被唤醒,所以this.isInterrupted()的值为false,while语句继续
                            
                        
                        2018-08-22
                
            
                                已采纳回答 / xjc想学编程
                                
                                                            final修饰的数组只是说你的数组不能再指向其他数组对象, 但它指向的数组的内容是可以变的!而final修饰的锁对象为了保证多线程进行过程中的安全
                            
                        
                        2018-08-02
                
             
             
        












