1
喜Ive得到INTS的公共數組,我想存儲1或數組中2,但即時得到錯誤NullPointerException異常什麼IM做的是這個着填充陣列的Java
public int[] which;
public int gotIt;
public void Check()
{
int cont = 0;
System.out.println(intento[0]);
for(int j = 0;j <= spaces;++j)
{
if(tries[0] == words[numRandom][j])
{
which[gotIt] = j;//im getting the error here
gotIt++;
}
else
{
cont++;
}
}
if(Contador == espacios+1)
{
Errors++;
System.out.println("There was an error");
}
repaint();
}
的錯誤是,當IM填充所謂的變量,我不知道這是什麼原因,非常感謝你
ow noob錯誤謝謝你 – Makenshi