Java tutorial
//package com.java2s; public class Main { public static boolean canWait = true; public static void waitHere() { waitHere("hit a key..."); } public static void waitHere(String msg) { System.out.println(""); System.out.println(msg); if (canWait) { try { System.in.read(); } catch (Exception e) { } // Ignore any errors while reading. try { System.in.read(); } catch (Exception e) { } // Ignore any errors while reading. } } }