Monday, June 22, 2015

Java–Array equals function

Java–Array equals function

 

 

package ArrayMethod;

import java.util.Arrays;

public class equals {

public static void main(String[] args) {
int a[] = { 3, 4, 2, 1 };
int b[] = { 3, 4, 2, 1 };
int c[] = { 3, 4, 2 };
System.out.println(Arrays.equals(a,b));
System.out.println(Arrays.equals(a,c));

}

}

No comments:

Post a Comment