Java数组扩容操作会改变地址的验证
import java.util.Arrays;
public class ArrayUseDemo
{
public static void main(String []args)
{
int [] arr = {1,2,3,4,5,6};
System.out.println(arr);
System.out.println(Arrays.toString(arr));
arr = Arrays.copyOf(arr,2);
System.out.println(arr);
System.out.println(Arrays.toString(arr));
}
}