Using Lambda Expression to foreach a List object in Java
In this tutorial, I will show you all how using Lambda Expression to foreach a List object in Java. OK, let’s get started! Usually from Java 7 and earlier, whenever you want to print out elements in a List object, for example:
1 2 3 4 |
List<String> names = new ArrayList<>(); names.add("Khanh"); names.add("Tan"); names.add("Thanh"); |
We usually… Read More