Code example for Scanner

Methods: close, nextLine

0
    } 
 
    static void pressEnter() { 
        if (waitForEnter) {
            System.out.println("Press ENTER to continue...");
            Scanner scan = new Scanner(System.in);
            scan.nextLine();
            scan.close();
        } 
    } 
 
    public static void main(String[] argv) {
        waitForEnter = true;
        Class<?> [] classesArray = {
            ColorJdkTest.class, 
            ColorLog4jTest.class, 
            ColorLog4jXmlTest.class, 
            ColorLogbackTest.class 
        }; 
        JUnitCore.runClasses(classesArray);
    }