标签:str i++ var java ble log oid 访问 turn
Java中的可变参数通过数组来访问
package practise; public class Variable { public static void main(String[] args) { System.out.println(add(1,2)); System.out.println(add(1,2,3,4)); } public static int add(int x,int ... args){ int sum = x; for (int i = 0; i < args.length; i++) { sum +=args[i]; } return sum; } }
result: 3
10
标签:str i++ var java ble log oid 访问 turn
原文地址:http://www.cnblogs.com/andypengyong/p/7183849.html