Java Threads Question:

Why would you use a synchronized block vs. synchronized method?

Tweet Share WhatsApp

Answer:

Synchronized blocks place locks for shorter periods than synchronized methods.

Download Java Threads PDF Read All 38 Java Threads Questions
Previous QuestionNext Question
When you will synchronize a piece of your code?What is an objects lock and which objects have locks?