Is there anyway I can use some boolean expression to see if what I want to access is out of bounds?
if you have array like this(int[] a = new in[10]) you can test it like
if(index < a.length)
or if you have ArrayList<Integer> b = new ArrayList<Integer>();
you can test it like
if( index < b.size())