[Solved] how to compare multiple arrays? [closed]


if(temp[i].equals(object[j])) // It shows arrayout of bound exception

Don’t want personally to be “Captain Obvious”, but it’s a good idea to check an index vs the array length before trying to access array item by index. For example:

if((object.length > j) && (temp[i].equals(object[j])))

And yes, use “Array.equals()” to compare arrays, as @Prateek proposed before.

solved how to compare multiple arrays? [closed]