Monthly Archives: December 2013

Convert integer array to integer

This is a simple function on how one can convert an integer array (int[]) to integer value

public int add(int[] array) {
int len = array.length;
int tmp = 0;
for(int i: array){
tmp += i*((int)Math.pow(10,--len));

return tmp;

Exception java.util.ConcurrentModificationException on ArrayList

If you encounter exception:

Exception in thread “main” java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(
at java.util.AbstractList$

You can go around and use CopyOnWriteArrayList<E>() instead.