public class Testargs {
//三个 方法重载
public void say()
{
System.out.println("hello");
}
public void say(String str1)
{
System.out.println("hello"+str1);
}
//可变个数的形参 写在不可变参数之后。 和数组一样
public void say(int i,String ... args)
{
for(i=0;i<args.length;i++)
{
System.out.println(args[i]);
}
}
public static void main(String[] args) {
Testargs t=new Testargs();
t.say();
t.say(new String[]{5,"hello","asdasd"});
}
}