Suppose my Foo class looked like this:
public class Foo { public static void func_1() { } public static void func_2() { } }
and that the Bar class looked like this:
public class Bar { public void method_1() { synchronized(Foo.class) { Foo.func_1(); } } }
Now instead of locking the Foo.class object in Bar.method_1 , can I declare Foo.func_1 and Foo.func_2 as synchronized and still archive the same target?
thanks
source share