Pergunta de entrevista da empresa Google

What guarantees does the synchronized keyword give when used on a method? When a thread calls the synchronized method, can another thread call a method that isn't synchronized on the same object?

Resposta da entrevista

Sigiloso

17 de mai. de 2011

The synchronized keyword guarantees that a thread that thread calling the method cannot be preempted by another thread, eg. the thread wont be interrupted when its inside the scope of the synchronized method. Another thread can call a non synchronized method on the same object when another thread is inside the synchronized method.