public void doService() throws IOException { while (true) { if (!in.hasNext()) return; String command = in.next(); if (command.equals("QUIT")) return; executeCommand(command); } }