可变个数形参的方法
package com.atguigu.java1;
public class MethodArgsTest
{
public static void main(String[] args)
{
MethodArgsTest test = new MethodArgsTest();
test.show(12);
test.show("Hello");
test.show("Hello" , "World");
test.show();
test.show("AA","BB","CC");
}
public void show(int i ) {
}
public void show(String s) {
System.out.println("show(String)");
}
public void show(String ... strs) {
System.out.println("show(String .. strs)");
for(int i = 0;i<strs.length ; i++) {
System.out.print(strs[i] + " ");
}
}
public void show(int i,String ... strs) {
}
}