Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is synchronized static method legal in Java?

Tags:

java

methods

Is synchronized static method legal in Java?


1 Answers

Yes. It gets the lock on the object representing the class the method is defined in (eg MyClass.class)

like image 64
idrosid Avatar answered Jul 12 '26 01:07

idrosid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!