The synchronized static method in MyClassessentially coincides with the block synchronized(MyClass.class). The second example should be rewritten as
synchronized(Foo.class) {
}
to be true.
, , . , synchronized , .
" ", , synchronized, synchronized, synchronized , .