How to read a File content into String in Java?

Views: 172 Ask New Question


How can i read the full content of a file into a String in Java?

On By

1 Answer


String fileContent = new String(Files.readAllBytes(Paths.get("/path/to/file.txt")));
On By


Answer This Question