请问有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"); }}
{:6_267:} 学习学习 {:6_269:}
页:
[1]