Skip to content

Instantly share code, notes, and snippets.

@arn-e
Last active December 11, 2015 03:59
Show Gist options
  • Save arn-e/4542013 to your computer and use it in GitHub Desktop.
Save arn-e/4542013 to your computer and use it in GitHub Desktop.
unhandled checked exception java
import java.io.*;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.util.List;
import java.nio.file.Paths;
public class FileReaderTest {
public static void main(String[] args) {
String filename = "./public/index.html";
List<String> allLines = Files.readAllLines(Paths.get(filename), Charset.defaultCharset());
for ( String i : allLines ) {
System.out.println(i);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment