When you write a program, I think sometimes you would like to prontall elements in collection for debugging purpose.
Before Jva 7 we need to wrote small code snippet for iterating collection and printing out its element.
However in Java 8 you can write this kind of code quite quickly.
Here is an example for printing out all system properties.
Before Jva 7 we need to wrote small code snippet for iterating collection and printing out its element.
However in Java 8 you can write this kind of code quite quickly.
Here is an example for printing out all system properties.
System.getProperties().entrySet().stream().forEach(System.out::println);I think the advantedge of this code is readability and writability - You can read or write code just from left to right :D
コメント