int[] numbers = {10,20,30,40,50}; String[] indexElements = IntStream.range(0, numbers.length).mapToObj(i -> i + ":" + numbers[i]).toArray(String[]::new); System.out.println(" "+ Arrays.toString(indexElements)); ------------------------------------------------------------------------------ int[] numbers = {10,20,30,40,50}; int sum = IntStream.of(numbers).sum(); System.out.println(" "+ sum);