I\'m aware of the fact that I could just do a:
while(Arrays.equals(array1, array2))
and then just write the code needed in the else>
else>
Whats wrong with
if( !Arrays.equals(array1, array2) )
array1.equals(array2) is the same as array1 == array2, i.e. is it the same array. And it's not what most people expect.
array1.equals(array2)
array1 == array2
Arrays.equals(array1, array2) compares the contents of the arrays.
Arrays.equals(array1, array2)