chcę użyć ArrayList zamiast tablicy na następujący kod:2d ArrayList placement
for(int k=0;k<SIZE;k++) //size is 9
for(int j=0;j<SIZE;j++)
ar1[k][j] = buttons[k][j].getText();
To jak ArrayList powinien wyglądać Chyba:
ArrayList<ArrayList<String>>ar1 = new ArrayList<ArrayList<String>>();
Ale to jest tak mylące, ponieważ Nie mogę użyć metody get .. Nie wiem jak to zrobić.
Ale muszę wstawić wartość do ArrayList. ar1.get (k) .get (j) .add (coś) nie jest możliwe –
ar1.get (k) .set (j, coś); – Doorknob
Lub ar1.get (k).dodać coś); dodać element – Doorknob