Java Array class equals(short[] a, short[] a2) example
Array class equals(short[] a, short[] a2) method example
Array class equals(short[] a, short[] a2) method example.This example shows you how to use equals(short[] a, short[] a2) method.This method Returns true if the two specified arrays of Short are equal to one another.
Here is the code:-
/**
* @Program that Returns true if the two specified arrays of Short are equal
* to one another.
* equals9Array.java
* Author:-RoseIndia Team
* Date:-16-May-2008
*/
import java.util.*;
public class equals9Array {
public static void main(String[] args) {
//Declaring a short Array
short o[]={-3,1,2,3,4,5,6};
short o1[]={-3,1,2,3,4,5,6};
//Returns true if the two specified arrays of shorts are equal
boolean b=Arrays.equals(o, o1);
System.out.println("The two specified arrays of Short are equal :-" +b);
}
} |
Output of the program:-
| The two specified arrays of Short are equal :-true |
|