public static void main(String[] args) { print("a"); print("a", "b"); print("a", "b", "c"); } public static void print(String ... s){ for(String a: s) System.out.println(a); }
String.format("An integer: %d", i); String.format("An integer: %d and a string: %s", i, s);
原文地址:http://blog.csdn.net/u010133536/article/details/42612107