java 8 advanced for loop code example Example: inline foreach java names.forEach(name -> System.out.println(name));