public class Test { public static void main(String[] args) { Thread t=new Thread(){ public void run() { fun(); }; }; //注意这里不是启动线程,这是调用Thread类的run方法,启用线程要用t.start() t.run(); System.out.println("22222222"); } static void fun(){ System.out.println("1111111"); }}输出111111122222222