(String[] args)
| 8 | |
| 9 | public class StreamInAndOut { |
| 10 | public static void main(String[] args) { |
| 11 | try( |
| 12 | Stream<String> input = |
| 13 | Files.lines(Paths.get("StreamInAndOut.java")); |
| 14 | PrintWriter output = |
| 15 | new PrintWriter("StreamInAndOut.txt") |
| 16 | ) { |
| 17 | input |
| 18 | .map(String::toUpperCase) |
| 19 | .forEachOrdered(output::println); |
| 20 | } catch(Exception e) { |
| 21 | throw new RuntimeException(e); |
| 22 | } |
| 23 | } |
| 24 | } |