Java Arrays.equals(short[] a, short[] a2)
Syntax
Arrays.equals(short[] a, short[] a2) has the following syntax.
public static boolean equals(short[] a, short[] a2)
Example
In the following code shows how to use Arrays.equals(short[] a, short[] a2) method.
/*w w w . ja va 2 s .co m*/
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
short[] arr1 = new short[] { 4, 1, 15, 6 };
short[] arr2 = new short[] { 4, 1, 15, 6 };
short[] arr3 = new short[] { 3, 1, 6, 12 };
System.out.println(Arrays.equals(arr1, arr2));
System.out.println(Arrays.equals(arr2, arr3));
}
}
The code above generates the following result.
Home »
Java Tutorial »
java.util »
Java Tutorial »
java.util »