The following:
class ArrayCompare
{
public static void main (String[] args)
{
int []arr1 = {1, 2, 3, 4, 5};
int []arr2 = {1, 2, 3, 4, 5};
System.out.println("arr1 == arr2 is " + (arr1 == arr2));
}
}
Returns arr1 == arr2 is false
Why is this? Why is arr1 Equals to arr2
is false
.
Should this not be true?