java input是什么意思_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
9. System.out.println("第"+(i+1)+"個Integer參數是"+itgr[i]+";");
1.1個Integer參數傳入!
2.the input string is-->
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 input是什么意思_java中的【...】表示什么意思的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java把一段英文拆成单词_java编程
- 下一篇: 成都工商备案过的刻章公司(成都工商备案)