Ad
Code
Diff
  • import java.util.Arrays;
    public class Adder 
    {
      public static int AddAllContent(int[] numbersToAdd) 
      {      
         return Arrays.stream(numbersToAdd).sum();
      }
    }
    • import java.util.stream.IntStream;
    • import java.util.Arrays;
    • public class Adder
    • {
    • public static int AddAllContent(int[] numbersToAdd)
    • {
    • int sum = IntStream.of(numbersToAdd).sum();
    • return sum;
    • return Arrays.stream(numbersToAdd).sum();
    • }
    • }