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. 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
IT関連の技術やプログラミングを中心に記事を書いています。ハードウェアも好きなので、日々のちょっとしたお役立ち情報も投稿しています。