Sonir:
here is part of the explanation of Clone method from the API .
Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:
x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
If you do an == comparison on two reference variables, then the comparison returns true ONLY if both variables point to the same object. Otherwise , this comparison returns false.
Since the second array is a clone of the first array, and these both are arrays of a primitive ( int ) naturally the elements within the array have the same values.
My guess is if this were an array of Strings, then even the OrigArray[i]==CloneArray[i] would return false , but OrigArray[i].equals(CloneArray[i]) would return true.
HTH