System.out.println("Please Enter the Size of your arrays");
int arraysize = in.nextInt();
//initalize array
int [][] aOne = new int[arraysize][arraysize];
int [][] aTwo = new int[arraysize][arraysize];
int [][] aSum = new int[arraysize][arraysize];
// load array 1
for (int i = 0; i< aOne.length; i++){
for(int x = 0; i<aOne[i].length;x++){
aOne[i][x] = ((int)(Math.random()*15));
}
}
上面的數組...應該工作,不是嗎?我不知道爲什麼我無法用Math.random填充它。我遇到了這個數組的麻煩,它會一直返回一個超出界限的錯誤,爲什麼?
有什麼建議嗎?
你的內循環是指'i' ...'I'AONE [I] .length'應該是'X
dcsohl
這個問題似乎是脫離主題,因爲它是關於明顯的錯字。 –
@JoshuaTaylor - 這會如何使這個題外話? – admdrew