I'm little confused about behaviour for synhronization (static and non static method).
For example:
1.
class MyClass {
...
public synchronized static someMethod() {
...
}
public static someMethod2() {
...
}
...
}
So if thread A call someMethod1(), does thread B have lock on someMethod2()?
2.
class MyClass {
...
public synchronized someMethod() {
...
}
public someMethod2() {
...
}
...
}
If we have MyClass a = new MyClass(),thread A call method someMethod(),does thread have lock on someMethod2()?