这是报的错误 java: 找不到符号 符号: 类 copyOf 位置: 类 java.util.Arrays

import java.util.Arrays;
import java.util.Random;

public class MinArray {
    public static void main(String[] args) {
        int arr[] =new int[10];
        Random ran =new Random();
        for(int i=0;i<arr.length;i++)
        {
            arr[i]=ran.nextInt(100);

        }
        System.out.println("数组数据为:"+ Arrays.toString(arr));
        int min=arr[0];
        for(int i=0;i< arr.length;i++)
        {
            if(min>arr[i])
            {
                min=arr[i];
            }
        }
        System.out.println("min:"+min);
        arr = new Arrays.copyOf(arr,arr.length+1);//这里copyOf报红 。
        arr[arr.length+1]=min;
        System.out.println("数组中的数据为:"+Arrays.toString(arr));

    }
}


qq_慕侠6290277
浏览 2936回答 0
0回答

慕斯4360584

ANRFFEEQQDQQHTGUHTHGTTBLZMAZOASERXLXKKKWPPOOAZMSSFSSSFEQQEVWVIIVUTHGFEGFFRDIIYJNAAZBAMZMCAQUQUMRYPHJPJDVGPHAJDSDVDJDXEXJPEJVXXJWJIIHDPPHTTFEEDDGUGGSFRRIVHOCBDQPTIUHGGFRFEEEVJIVDBASSEEDQCCCNAZNNFPCCOTFTTFSXKXWWVGFSEREEDDQOAZYZMMEQCCMXWJVINAMLLTRVVVVIHTTFLJVVNMMMYXJKIHWWIWVUUUEQCHJJWIIHUUTSRRSFRQDQKOJWIKJFVVQKPNGFSAJSYDDRTFBXJBXALUXGCHKZTRJFPYXRKWVYXINDEMMUZXSNXMSKVVSOXFUMQZPSTNGHTIZPSANAYBAPHLCKKEUWUHKBDGZZVTCRDLOUARFVOQVJPHJEUWHGVEGJFODRFOSNIHMGZDINTJMOOUPFBBNSKDIEAGCBJQIXGSONGDBNTLESOYKJHXQRAMFGCOEAGWBIRBAPVKVBFBBNYKDMEXHVDWVFYDFXOINRTCVMNCHAAVTCPFDVCACCVTDEDYEKQNSTDZEONJMRHRQIBYDWQPZRAABKVNKKPRCSPSILHTEGUCIMCJIWZVUFUGAIGPIUTPJCUAJYSOEQLATVTDDSUIOGPVNBZUOEDSVEXLTMRTQJCBGMOKOBCVIRRXDZJKYUDPODTFOCQXSLXSAJKY
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java