If without converting the below lines to string can it work fine? Do I need to use the Stream <String>
in front of the lines = Files.lines(Paths.get("c:\\demo.txt"));
to convert the file lines into strings? Or it is unnecessary to do that ?
lines = Files.lines(Paths.get("c:\\demo.txt"));
lines.forEach(System.out::println);
lines.close();
I'm new to Java, I don't really know about the use of Stream <String>
in the coding. Is it meant to convert the lines to strings or something else? So I posted this question.