Java Reference
In-Depth Information
/* not included for brevity. Prints out a
Welcome message with the available commands */
dumpWelcomeMessage();
while (true){
command = IOUtils.readLine("> "); [4]
if (command.equals("book")) { [5]
int seatId = 0;
try {
seatId = IOUtils.readInt("Enter
SeatId");
} catch (NumberFormatException e1) {
logger.info("Wrong seatid format!");
continue;
}
try {
String retVal =
book.bookSeat(seatId-1);
}
catch (SeatBookedException e) {
logger.info(e.getMessage());
continue;
}
catch (NotEnoughMoneyException e) {
logger.info(e.getMessage());
continue;
}
}
else if (command.equals("list")) { [6]
logger.info(info.printSeatList().toString());
continue;
}
Search WWH ::




Custom Search