package com.ceo2a.test;
import java.util.Arrays;
public class Test {
public static void main(String[] args) {
int[] arr1={5,6,9};
int[] arr2={6,5,9};
int[] arr3={5,6,9};
System.out.println("arr1 == arr2 ? "+Arrays.equals(arr1, arr2));
System.out.println("arr1 == arr3 ? "+Arrays.equals(arr1, arr3));
}
}
How do you check the equality of two arrays in java? |
Awesome Altaf,keep doing great job
ReplyDelete