日期:2014-05-20  浏览次数:20969 次

练习题求指教
Java code

        Runnable r = new Runnable(){
            public void run(){
                System.out.print("Gaston.");
            }
        };
        SwingUtilities.invokeLater(r);
        try{sleep(1000);}catch(Exception ex){}
        System.out.print("Alphonse.");



Java code

        Runnable r = new Runnable(){
            public void run(){
                System.out.print("Gaston.");
            }
        };        
        try{
                        SwingUtilities.invokeAndWait(r);
                        sleep(1000);
                }catch(Exception ex){}
        System.out.print("Alphonse.");


这两段代码的输出有如下选择(第一题是多选,第二题是单选):
A. Gaston.
B. Alphonse.
C. Gaston.Alphonse.
D. Alphonse.Gaston.

能告诉一下解题思路么?

------解决方案--------------------
第一個是兩個都有可能
第二個是gaston