Compare two short type arrays in Java
Description
The following code shows how to compare two short type arrays.
Example
/*from w ww . ja va2 s . c o m*/
import java.util.Arrays;
public class Main {
public static void main(String[] argv) throws Exception {
boolean b = Arrays.equals(new short[] { 0 }, new short[] { 0 }); // true
System.out.println(b);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »