java中【...】指的是什么意思-创新互联
                                            这篇文章给大家分享的是有关java中【...】指的是什么意思的内容。小编觉得挺实用的,因此分享给大家做个参考。一起跟随小编过来看看吧。

...表示可变长参数,就是说这个位置可以传入任意个该类型参数,简单来说就是个数组。
代码示例:
1. testPoints(7);  
2.        testPoints(7,9,11);  
3.        testPoints(new Integer[]{7,9,11});  
1.  public static void testPoints(Integer... itgr){  
2.        if(itgr.length==0){  
3.            System.out.println("没有Integer参数传入!");  
4.        }else if(itgr.length==1){  
5.            System.out.println("1个Integer参数传入!");  
6.        }else{      
7.            System.out.println("the input string is-->");  
8.            for(int i=0;i  
3.第1个Integer参数是7;  
4.第2个Integer参数是9;  
5.第3个Integer参数是11;    
6.the input string is-->  
7.第1个Integer参数是7;  
8.第2个Integer参数是9;  
9.第3个Integer参数是11; 感谢各位的阅读!关于java中【...】指的是什么意思就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到吧!
网页题目:java中【...】指的是什么意思-创新互联
分享地址:http://www.scyingshan.cn/article/ighdj.html

 建站
建站
 咨询
咨询 售后
售后
 建站咨询
建站咨询 
 