This code converts the String array to an int array and calculate the sum of all int array elements:
String[] input = { "2", "1", "5", "1" };
int[] results = Stream.of(input).mapToInt(Integer::parseInt).toArray();
int sum = Arrays.stream(results).sum();
System.out.println("SUM: " + sum);
The shorter version if you don't require the int[] array:
String[] input = { "2", "1", "5", "1" };
int sum = Stream.of(input).mapToInt(Integer::parseInt).sum();
System.out.println("SUM: " + sum);
This works for Java 8 and higher.