Jan
30
|
The Arrays class includes methods for testing the equality of two array. Two arrays are considered equal if both arrays contain the same number of elements, and all corresponding pairs of elements in the two arrays are equal.
if (Arrays.equals(array1, array2)) { // array1 and array2 contain the same elements in the same order }
Array ( ) 2 Responses to “How to check if two Java arrays are equal?”
Leave a Reply
You must be logged in to post a comment.
June 26th, 2012 at 1:27 pm
no its not working error
June 26th, 2012 at 2:03 pm
Need some more details about how its not working