public class Solution { private static final List<String> WORDS = Arrays.asList( "JDK 17 has released on 14 September 2021 with 10 new features, 2 feature removals and 2 feature deprecations." .split(" ")); public static void main(String[] args) throws NumberFormatException { Iterator<String> words = WORDS.iterator(); int sum = 0; String justWords = ""; try { while (words.hasNext()) { String next = words.next(); int number = Integer.parseInt(next); //...продолжить код нужно здесь!!!!! } System.out.println("Sum is " + sum); System.out.println("Just words:" + justWords); } catch (NumberFormatException e) { System.out.println(e); } } }