list.forEach in openjdk12 code example Example: inline foreach java names.forEach(name -> System.out.println(name));