Bien ! Donc voici mon programme-test ( un brouillon donc destiné à m’entraîner sur cette histoire d'ArrayList avant de m'occuper du programme qui m’intéresse ) :
-----------------
import java.util.Scanner;
import static java.lang.System.out;
import java.util.ArrayList;
public class New1 {
private static Scanner sc;
public static void main(String[] args) {
char reponse = 'O';
sc = new Scanner(System.in);
ArrayList<Integer> al = new ArrayList<Integer>();
out.print("Lancer le programme ? (O/N) : ");
reponse = sc.nextLine().charAt(0);
while (reponse == 'O')
{
out.print("=> ");
int a = sc.nextInt();
al.add(a);
}
}
}
----------------
Chaque saisie est prise en compte par le programme ?