这样写:
class A extends Thread
{
public void run()
{
          wile(true){
         output();
         try{
         sleep(3000);

}catch(InterruptedException ie){System.out.println(ie.getMessage());}
          }
public synchronized void output()
{
System.out.println("123456789");
}
}
public class B1 extends A
{

public static void main(String[] args) 
{
B1 b=new B1();
b1.start();
}
}
一般不是多继承就没必要实现那个runnable接口,直接继承thread类