From 0c5793abf9cf5efe97eed6f778e18171198ff857 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Sun, 23 Feb 2014 22:31:31 +0100 Subject: Use iterator --- src/esieequest/Room.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/esieequest/Room.java b/src/esieequest/Room.java index 0ba71d9..4626490 100644 --- a/src/esieequest/Room.java +++ b/src/esieequest/Room.java @@ -1,6 +1,7 @@ package esieequest; import java.util.HashMap; +import java.util.Iterator; import java.util.Set; /** @@ -85,9 +86,9 @@ public class Room { */ public String getExitString() { String vExitString = "Available exits:"; - Set keys = this.aExits.keySet(); - for (String exit : keys) { - vExitString += " " + exit; + Set vKeys = this.aExits.keySet(); + for (Iterator vIter = vKeys.iterator(); vIter.hasNext();) { + vExitString += " " + vIter.next(); } vExitString += "."; return vExitString; -- cgit v1.2.3