From 2ab56c21ee1d07be3dd2119094155ca06a0a5c59 Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Tue, 17 Mar 2020 12:23:50 +0100 Subject: [PATCH] Update terminal file --- src/edu/kit/informatik/Terminal.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/edu/kit/informatik/Terminal.java b/src/edu/kit/informatik/Terminal.java index 86e51aa..de16f9b 100644 --- a/src/edu/kit/informatik/Terminal.java +++ b/src/edu/kit/informatik/Terminal.java @@ -24,11 +24,7 @@ public final class Terminal { * of characters, arrays, and lines. This stream is already open and ready to supply input data and corresponds * to keyboard input. */ - private static BufferedReader IN = new BufferedReader(new InputStreamReader(System.in)); - - public static void reload() { - IN = new BufferedReader(new InputStreamReader(System.in)); - } + private static BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); /** * Private constructor to avoid object generation. @@ -68,6 +64,13 @@ public final class Terminal { System.out.println(object); } + /** + * xx. + */ + public static void reload() { + in = new BufferedReader(new InputStreamReader(System.in)); + } + /** * Prints an array of characters and then terminate the line. * @@ -97,9 +100,9 @@ public final class Terminal { */ public static String readLine() { try { - String line = IN.readLine(); + String line = in.readLine(); while (line != null && line.startsWith("#")) { - line = IN.readLine(); + line = in.readLine(); } if (line == null) { return "quit";