chariel 发表于 2013-1-23 05:57:32

请问有java高手愿意帮忙分析这题目的答案么,贵求高手的解答,感激不尽


If these methods are called from two different threads at the same time, what will be the result?

public class FirstWord {
       public static synchronized void writeFirstWord(boolean fromSecondWord) throws Exception {
            if(fromSecondWord == false)
                     SecondWord.writeSecondWord();
            System.out.print("Redflex"); }}

public class Second Word {
       public static synchronized void writeSecondWord() throwsException {
            Thread.sleep(100);
            FirstWord.writeFirstWord(true);
            System.out.print(" Traffic Systems"); }}


mhchen2012 发表于 2013-3-30 12:43:13

{:6_267:}

木宇龙 发表于 2013-5-1 09:35:06

学习学习

geluyun 发表于 2013-7-1 10:04:58

{:6_269:}
页: [1]
查看完整版本: 请问有java高手愿意帮忙分析这题目的答案么,贵求高手的解答,感激不尽