Remove synchronized from nextSerialNumber
Here I guess that the synchronized keyword is a typo.
This commit is contained in:
parent
7df16392cf
commit
ad67514d8f
@ -8,7 +8,7 @@ public class
|
||||
AtomicSerialNumbers extends SerialNumbers {
|
||||
private AtomicInteger serialNumber =
|
||||
new AtomicInteger();
|
||||
public synchronized int nextSerialNumber() {
|
||||
public int nextSerialNumber() {
|
||||
return serialNumber.getAndIncrement();
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user