package com.wuming.struct;public class Demo05 {public static void main(String[] args) {Demo05 demo05 = new Demo05();demo05.test(1,3,4,5,6,7);}public void test(int x,int... i){//int... i是可变参数,必须放最后面System.out.println(i[0]);System.out.println(i[1]);System.out.println(i[2]);} }
3
4
5