To compare two strings in java I used following code
String ary[]={"man","john","su"};
String ary1[]={"john","man","su"};
if(Arrays.equals(ary,ary1)) {
System.out.println("equal");
} else {
System.out.println("not equal");
}
It prints "not equal",But this two arrays are having same values.
Indeed here the both arrays are same but values positions change.
How can I tell that this kind of arrays are same.