Breaking News
Home / Java / Java Snippets / How to Read Lines from File As String Array?

How to Read Lines from File As String Array?

File Reader as String This snippet shows how read all the lines of a file into an array and finally print the lines. It uses the FileReader to open the file, then reads the each of the lines using the readLine() method and adds the line into the array.

 [pb_builder]

Check Also

How to progamatically get the Java version?

Snippet The key here is to use the system property java.version and get minor and …

Advertisment ad adsense adlogger