代码举例:
· public void callSingleName(Student stu){
· System.out.println(name+"点了"+stu.getName()+"的名字");
· System.out.println(stu.getName()+"回答 : 到");
· · }
· · public void callName(Student... stus){
· for (Student stu: stus) {
· callSingleName(stu);
· }
· · }
对象作为方法参数的好处:
1.控制参数来源
2.可以简化参数列表