test5.20

来源:互联网 发布:甘霖 配餐软件 编辑:程序博客网 时间:2024/05/16 09:00

按照题目的意思写出程序,确实有显示,但是这时候现实的效果与前一题完全一样,我就怀疑可能是args保留了前面程序运行的结果,是这吧19题的String改变,20题果然跟着变化,其中的原理我还不太明了。

/*target:Modify main() function enable it to receive 

 * changeable vector
 * methods:imitate the example before page105
 */
public class Test20 {
public static void main(Object...args) {
for(Object obj:args)
    System.out.print(obj+" ");
}
}
0 0
原创粉丝点击