当前位置: 代码迷 >> J2SE >> 练习求指教
  详细解决方案

练习求指教

热度:93   发布时间:2016-04-24 00:46:16.0
练习题求指教
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
  相关解决方案