I'm wondering what the difference is between these ways of synchronization
List<Integer> intList = Collections.synchronizedList(new ArrayList<Integer>());
synchronized (intList) {
//Stuff
}
and using an object lock
Object objectLock = new Object();
List<Integer> intList = new ArrayList<Integer>();
synchronized (objectLock) {
//Stuff
}