Home » JAVA Programming » Files and I/O » Question
  1. How to read entire file in one line using java 8?
    1. Files.read()
    2. Files.readFile()
    3. Files.lines()
    4. Files.readAllLines()
    5. None of these
Correct Option: D

Java 8 provides Files.readAllLines() which allows us to read entire file in one task. We do not need to worry about readers and writers.



Your comments will be displayed only after manual approval.