Inspect the line where you create your array...you've initialized an array of an array, with the first array of length zero (it should be of length > 0)


cardArray = new String[0][totalNoCards];