Java数组的值如何复制到另一个数组,帮我看看哪里错了

img

如果有帮助的话,请点击右上角【采纳】按钮,支持一下!!


没有问题呀!


    public static void main(String[] args)
    {
        int[] count = new int[5];
        Scanner mys = new Scanner(System.in);
        for (int i = 0; i < count.length; i++) {
            count[i] = mys.nextInt();
        }
        System.out.println("赋值后的数组:"+count[0]+count[1]+count[2]+count[3]+count[4]);

        int[] count2 = new int[count.length];
        for (int i = 0; i < count.length; i++) {
            count2[i] = count[i];
        }
        System.out.println("赋值后的数组:"+count2[0]+count2[1]+count2[2]+count2[3]+count2[4]);


img