以下のコメント文を元にコードを打ち込んでください
// 整数の配列 {5, 10, 15, 20} を用意する
// メソッド sumArray を使って合計値を求める
// 結果を 「合計は: 0」と出力する
// クラス名は SumCalculator とする
// for 文を使って加算する
public class SumCalculator{
public static void main(String[] args){
int[] numbers = {5, 10, 15, 20};
int result = sumArray(numbers);
System.out.println("合計は: " + result);
}
public static int sumArray(int[] arr){
int sum = 0;
for(int num : arr){
sum += num;
}
return sum;
}
}