what is the best way to read single line files in Java -


Is it necessary to create a buffer reader while reading the loop and all single-line files? It also has no continuous change

How do I do this here:

  string txt = new scanner (new file (path)). Usage delimiter ("\\ Z"). Next ();  

A complete file will be read in this string.

Let me break it down for you:

  string txt = // resulting in string stored here (// file to read new file To create a scanner ("PathToFile") // read a new file in the scanner. UseDelimiter ("\\ Z") // Set the delimiter at the end of the file .next (); // Read the scanner up to the next delimiter, // in this case it is the end of the file.  

Comments