package com.lovecoding.day08.oop03;

public class TestChangeParam {

    public int sum(int ... arr){
        //可变参数 数组
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum +=arr[i];
        }
        return sum;
    }

    public static void main(String[] args) {
        TestChangeParam testChangeParam = new TestChangeParam();
        int sum = testChangeParam.sum(1,2,3);
        System.out.println(sum);
    }

}
