posted 18 years ago
Friends,
I was given the following class (IncrementImpl) already written. Now we have so many threads which access this concurrently. How can I make it synchronize it.
Please help me.
Thanks,
Senthil.
-------------------
public class IncrementImpl {
private static int counter = 0;
public synchronized void increment() {
counter++;
}
public int getCounter() {
return counter;
}
}