RT 还是只是终止这一个线程的运行 

解决方案 »

  1.   

    main线程的话会终止程序
    其他线程就是该线程断掉 
      

  2.   

    哪个线程有没有捕获的异常,哪个线程就终止,main线程的话整个程序就over了
      

  3.   


    不同意, java没有什么main线程。
    我的观点是: 这个线程因为没有捕获异常,而结束了。 简而言之,就是这个线程结束了。程序是否会结束,要看是所有其他线程都是 daemon 线程;如果不是,就不会退出。
    贴段jdk中代码加注释,    /**
         * Marks this thread as either a daemon thread or a user thread. The 
         * Java Virtual Machine exits when the only threads running are all 
         * daemon threads. 
         * <p>
         * This method must be called before the thread is started. 
          * <p>
         * This method first calls the <code>checkAccess</code> method 
         * of this thread 
         * with no arguments. This may result in throwing a 
         * <code>SecurityException </code>(in the current thread). 
        *
         * @param      on   if <code>true</code>, s this thread as a
         *                  daemon thread.
         * @exception  IllegalThreadStateException  if this thread is active.
         * @exception  SecurityException  if the current thread cannot modify
         *               this thread.
         * @see        #isDaemon()
         * @see        #checkAccess
         */
        public final void setDaemon(boolean on) {
    checkAccess();
    if (isAlive()) {
        throw new IllegalThreadStateException();
    }
    daemon = on;
        }
      

  4.   

    一个线程是main线程,只能说它的名字是Main. 
    可以它是最先启动的,但是它结束了,并不代表程序要一定要结束。