From: Jérôme Benoit Date: Wed, 14 Feb 2018 21:14:51 +0000 (+0100) Subject: Entiers, Pile: Print only the values in the stack. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=306320428497edce10fbd9e0b36204c8764b7273;p=TP_POO.git Entiers, Pile: Print only the values in the stack. Signed-off-by: Jérôme Benoit --- diff --git a/Entiers/Entiers.java b/Entiers/Entiers.java index 7251eb5..adcc822 100644 --- a/Entiers/Entiers.java +++ b/Entiers/Entiers.java @@ -98,7 +98,7 @@ class Entiers { public void afficher() { System.out.println("----"); - for (int i = 0; i < getSize(); i++) { + for (int i = 0; i < getCurrentSize(); i++) { System.out.println("element " + i + " " + int_array[i]); } } diff --git a/Piles/Pile.java b/Piles/Pile.java index 1c808c2..e2cc0c4 100644 --- a/Piles/Pile.java +++ b/Piles/Pile.java @@ -95,7 +95,7 @@ public class Pile { * [afficher description] */ public void afficher() { - for (int i = 0; i < getSize(); i++) { + for (int i = 0; i < getHeadIndex(); i++) { System.out.println("element " + i + " " + int_array[i]); } }