Code example for Scanner

Methods: closenextLine

0
        System.out.println(new Date());
 
    } 
 
    private void readFromConsole() { 
        Scanner in = new Scanner(System.in);
        in.nextLine();
        in.close();
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java