我是编程新手。而且我被困住了。我在网上搜索了有关netbeans导入问题的信息:http://wiki.netbeans.org/Java_EditorUsersGuide#How_to_get_rid_of_unused_imports,但是它不起作用

java - Netbeans包导入Intstream-LMLPHP

import java.util.*;
import java.util.stream.IntStream;

public class Array {
    public static void main(String[] args){
        int[] a1 = new int [10];
        a1[0]=1;
        Arrays.fill(a1,2);
        System.out.println(a1[0]);
        System.out.println(a1.length);
        String[] a2={"one", "two"};
        int[] oneTo10 = Intstream.rangeClosed(1,10).toArray();

        for(int x: oneTo10) System.out.println(x);

        System.out.println(Arrays.binarySearch(oneTo10,9));

        int a3[] [] = new int[2][2];
        String[][] a4={{"00","10"},
                {"01","11"}};
        System.out.println(a4[1][1]);

        String a5 [][][]={{{"000"},{"100"},{"200"},{"300"}},
                {{"010"},{"110"},{"210"},{"310"}},
                {{"020"},{"120"},{"220"},{"320"}}};
        System.out.println(a5[2][3][0]);

        int a6[]={1,2,3};
        int a7[] = Arrays.copyOf(a6,3);
        System.out.println(Arrays.equals(a6, a7));
        int a8[] = {3,2,1};
        Arrays.sort(a8);
        System.out.println(Arrays.toString(a8));
    }
}

最佳答案

您的代码中有错误。

int[] oneTo10 = Intstream.rangeClosed(1,10).toArray();

它的IntStream代替Intstream(注意小号s)。它将不报告未使用的导入。

关于java - Netbeans包导入Intstream,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55434618/

10-08 22:11