import java.util.*;
public class Deadlock extends Thread{
private String name;
public static void main(String[] args) {
}
public class MyObject{
public void synchronized foo(String name) { //throws error saying 'Syntax error on token "void", volatile expected'
}
}
}
但是,如果,public void synchronized改为 public synchronized void,一切都很好。
这是为什么?
慕哥6287543
喵喔喔
相关分类