Home > Back-end >  JavaScanner
JavaScanner

Time:10-30

Java small white, could you tell me how to write the

CodePudding user response:

I studied for a long time, really didn't understand, just feel boring, suddenly any language used for the console application may not, what's more, Java, study what it? !

CodePudding user response:

Try (Scanner Scanner=new Scanner (new File (" D:/log. The log "))) {
While (scanner. HasNextLine ()) {
System. The out. Println (scanner. NextLine ());
}
} the catch (FileNotFoundException e) {
e.printStackTrace();
}
  • Related