Bonne année à tous
J'essaye de faire fonctionner cette méthode avec comme condition le résultat d'un test sur boolean en vain ... qu'ai-je oublié ?
Merci d'avance
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 public static void afficherListeSections() { // Teste si le tableau tabSections (String) est vide boolean estVide = true; for (int i = 0; i < tabSections.length; i++) if (tabSections[i] != null) { estVide = false; break; } if (estVide= true) { Terminal.sautDeLigne(); Terminal.ecrireString("AVERTISSEMENT : Il n' existe encore aucune section, opération annulée ..."); Terminal.sautDeLigne(); } else{ // Affiche la liste des sections disponibles for (int j = 0; j < tabSections.length; j++) { if (tabSections[j] != null) { Terminal.ecrireStringln("Section n° " + (j + 1) + ": " + tabSections[j]); } } } afficherMenu(); }
Partager