我像这样初始化一个数组:
public class Array {
int data[] = new int[10];
/** Creates a new instance of Array */
public Array() {
data[10] = {10,20,30,40,50,60,71,80,90,91};
}
}
NetBeans在这一行指出一个错误:
data[10] = {10,20,30,40,50,60,71,80,90,91};
我怎么解决这个问题?
int myArray2[] = new int[3];
int[] myArray = new int[3];
int[] intArray = {13, 14, 15};
int[] intArray = new int[]{7, 8, 9};
int[] intArray = IntStream.range(1, 11).toArray();
int[] intArray = IntStream.rangeClosed(1, 10).toArray();
int[] intArray = IntStream.of(6, 2, 4, 5, 7).toArray();
int[] intArray = IntStream.of(6, 2, 4, 5, 7).sorted().toArray();