class xxxx extends Thread
xxxx里的run方法事实上应该也是在重写
接口Runable,是吧??

解决方案 »

  1.   

    是的,Thread实现了Runnable接口。
      

  2.   

    不过Thread已经自己实现了run方法,继承Thread的类自然是重写了这个run方法。
      

  3.   

    如果要用到多线程,尽量用Runnable,而少用Thread!
    类只能继随一个类,但能实现多个接口!
      

  4.   

    同意!给你源码:
    * @author  unascribed
     * @version 1.155, 06/26/04
     * @see     java.lang.Runnable
     * @see     java.lang.Runtime#exit(int)
     * @see     java.lang.Thread#run()
     * @see     java.lang.Thread#stop()
     * @since   JDK1.0
     */
    public
    class Thread implements Runnable {
        /* Make sure registerNatives is the first thing <clinit> does. */
        private static native void registerNatives();
        static {
            registerNatives();
        }    private char name[];
        private int         priority;
        private Thread threadQ;
        private long eetop;
        private boolean     started; // true iff this thread has been started    /* Whether or not to single_step this thread. */
        private boolean single_step;    /* Whether or not the thread is a daemon thread. */
        private boolean daemon = false;    /* Whether or not this thread was asked to exit before it runs.*/
        private boolean stillborn = false;    /* What will be run. */
        private Runnable target;    /* The group of this thread */
        private ThreadGroup group;    /* The context ClassLoader for this thread */
        private ClassLoader contextClassLoader;    /* The inherited AccessControlContext of this thread */
        private AccessControlContext inheritedAccessControlContext;    /* For autonumbering anonymous threads. */
        private static int threadInitNumber;
        private static synchronized int nextThreadNum() {
    return threadInitNumber++;
        }    /* ThreadLocal values pertaining to this thread. This map is maintained
         * by the ThreadLocal class. */
        ThreadLocal.ThreadLocalMap threadLocals = null;    /*
         * InheritableThreadLocal values pertaining to this thread. This map is
         * maintained by the InheritableThreadLocal class.  
         */ 
        ThreadLocal.ThreadLocalMap inheritableThreadLocals = null;    /*
         * The requested stack size for this thread, or 0 if the creator did
         * not specify a stack size.  It is up to the VM to do whatever it
         * likes with this number; some VMs will ignore it.
         */
        private long stackSize;    /*
         * Thread ID
         */
        private long tid;    /* For generating thread ID */
        private static long threadSeqNumber;    /* Java thread status for tools, 
         * initialized to indicate thread 'not yet started'
         */
        private int threadStatus = 0;
        private static synchronized long nextThreadID() {
    return ++threadSeqNumber;
        }    /* The object in which this thread is blocked in an interruptible I/O
         * operation, if any.  The blocker's interrupt method should be invoked
         * after setting this thread's interrupt status.
         */
        private volatile Interruptible blocker;
        private Object blockerLock = new Object();    /* Set the blocker field; invoked via reflection magic from java.nio code
         */
        private void blockedOn(Interruptible b) {
    synchronized (blockerLock) {
        blocker = b;
    }
        }
    还有很多
      

  5.   

    看下api就知道了,已经实现了
      

  6.   

    叫也无所谓吧,也没什么关系。
    从@override可以看的出来。