Home > AI > Language > Java >

forEach

List<String> items = new ArrayList<>();
items.add("coins");
items.add("pens");
items.add("keys");
items.add("sheets");

items.forEach(System.out::println);

Leave a Reply