1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
import java.util.ArrayList;
public class ArrayL {
/**
* @param args
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
ArrayList<ArrayList<Integer>> colonne = new ArrayList<ArrayList<Integer>>(10);
ArrayList<Integer> lignes = new ArrayList<Integer>(10);
int cpt =0;
for (int i = 0; i<colonne.size(); i++){
for (int j=0; j<lignes.size(); j++){
colonne.set(i, lignes);
lignes.set(j, cpt);
cpt++;
}
}
for (ArrayList<Integer> l : colonne){
for (int i=0; i<s.size(); i++){
System.out.print("["+colonne.indexOf(l)+"]"+"["+l.indexOf(s.get(i))+"] ="+l.get(i) );
}
}
}
} |
Partager