package Contoh;
/**
*
* @author APIN
*/
import java.util.ArrayList;
public class ArrayList2Dimensi {
public static void main(String[] args) {
int jmlKolom=2, jmlBaris=2;
ArrayList baris = new ArrayList();
for (int i=0;i<jmlBaris;i++) {
ArrayList kolom = new ArrayList();
for (int j=0;j<jmlKolom;j++) {
kolom.add(j, j+i);
System.out.print(kolom.get(j)+" ");
}
baris.add(i, kolom);
System.out.println();
}
}
}