Probably a very basic question but I'm still in doubt. Am I correct in assuming that
public synchronized void doSynchronized() {
for (int i = 0; i < 10000; i++) {
count++;
}
}
Is exactly the same as:
public void doSynchronized() {
synchronized (this) {
for (int i = 0; i < 10000; i++) {
count++;
}
}
}
???