Code example for Scanner

Methods: hasNextLine

0
     * Does the input have a next line? Use this to know whether the 
     * next call to {@link #readLine()} will succeed. <p> Functionally 
     * equivalent to {@link #hasNextChar()}. 
     */ 
    public static boolean hasNextLine() { 
        return scanner.hasNextLine();
    } 
 
    /** 
     * Is the input empty (including whitespace)? Use this to know  
     * whether the next call to {@link #readChar()} will succeed. <p> Functionally 
     * equivalent to {@link #hasNextLine()}. 
     */ 
    public static boolean hasNextChar() { 
        scanner.useDelimiter(EMPTY_PATTERN);
        boolean result = scanner.hasNext();
        scanner.useDelimiter(WHITESPACE_PATTERN);
        return result;
    } 
 
Connect your IDE to all the code out there  Get Codota for Java