【发布时间】:2011-05-22 15:39:45
【问题描述】:
假设我们有这两个示例代码:
public synchronized void getSomething(){
this.hello = "hello World";
}
还有这个
public void getSomething(){
synchronized(this){
this.hello = "hello World";
}
}
那么有人可以告诉我现在有什么不同吗?
【问题讨论】:
标签: java thread-safety