Generation

generate functionMon, 14 Nov 2022

append a string to all items in a List

public static void main(String[] args) { List<String> str = new ArrayList<>(Arrays.asList("hello", "world", "good", "night")); str.stream().map(s -> s + " World").forEach(System.out::println); }

Want to kickstart your project?Use the new AI Studio to create your code