class Test {
static int vClass = 0;
int object = 0;
static synchronized void incrementClass() {
try {
System.out.println("Dive into incrementClass " + Thread.currentThread().getName());
Thread.sleep(3000);
vClass++;
} catch (InterruptedException e) {}
}
synchronized void incrementObject() {
try {
System.out.println("Dive into incrementObject " + Thread.currentThread().getName());
Thread.sleep(3000);
object++;
} catch (InterruptedException e) {}
}
}