Synchronized methods can be static - a thread acquires the class monitor before executing the static
synchronized methods
! Synchronization of static methods in a class is independent from the synchronization of instance methods
on objects of the class
synchronized methods
! Synchronization of static methods in a class is independent from the synchronization of instance methods
on objects of the class
普通单线程程序,现在我们用的是串行的程序执行,
而synchronized关键字是用来在多线程执行的时候用来保持同步,和你说的情况,不是一回事,
你的情况不管用不用synchronized关键字,在同一个时刻只能有一个代码段执行。