We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fee263c commit 0c4f633Copy full SHA for 0c4f633
src/com/winterbe/java8/samples/misc/Files1.java
@@ -21,6 +21,17 @@ public static void main(String[] args) throws IOException {
21
testReader();
22
testWriter();
23
testReadWriteLines();
24
+ testReaderLines();
25
+ }
26
+
27
+ private static void testReaderLines() throws IOException {
28
+ try (BufferedReader reader =
29
+ Files.newBufferedReader(Paths.get("res", "nashorn1.js"))) {
30
+ long countPrints = reader.lines()
31
+ .filter(line -> line.contains("print"))
32
+ .count();
33
+ System.out.println(countPrints);
34
35
}
36
37
private static void testWriter() throws IOException {
0 commit comments