Computer Science, asked by aryankaushik1508, 3 days ago

Write a program to initialize an array 'list'
with 10 numbers display the product of odd index in Java. ​

Answers

Answered by devindersaroha43
1

Answer:

Explanation:

// include java.util.*

List<Integer> numList = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);

Integer sumValue = numList.stream().mapToInt(Integer::intValue).sum();

System.out.println(sumValue);

Similar questions
Math, 8 months ago