I noticed interesting behaviour:
I can write
class My {
public My(){
synchronized(this){
// code
}
}
}
but I cannot write
class My {
public synchronized My(){
// code
}
}
}
I thought that both constructions works identically terms java API.
Please clarify this misunderstanding.