Perhaps I don't understand how clone()
works. Shouldn't the return value equal the caller?
int[] nums = new int[] {0, 1, 2};
int[] list = nums.clone();
nums.equals(list); //returns false. Why?
for (int ket = 0; ket < list.length; ket++) {
System.out.println(list[ket] == nums[ket]); //prints out true every time
}
list == nums //false