📜  数组java代码示例中所有数字的总和

📅  最后修改于: 2022-03-11 14:52:42.841000             🧑  作者: Mango

代码示例1
int[] a = {10,20,30,40,50};
int sum = IntStream.of(a).sum();
System.out.println("The sum is " + sum);