I got a question about synchronized. I got a threaded application and I want to lock an array to be shore I'm not trying to update it while using it.
Here is what I do:

public void a() {
synchronized (array) {
//do some stuff

public void b(Array newArray) {
array = newArray;

Does this protect me from not updating the array from function b while using it in function a or do I have to do something more, maybe synchronize function b?