From 306320428497edce10fbd9e0b36204c8764b7273 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 14 Feb 2018 22:14:51 +0100 Subject: [PATCH] Entiers, Pile: Print only the values in the stack. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- Entiers/Entiers.java | 2 +- Piles/Pile.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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]); } } -- 2.34.1