public class Main {
public static void printArbitraryStrings(String... ss) {
for (int i=0; i < ss.length; i++) {
System.out.printf("String %d: %s \n", i, ss[i]);
}
}
public static void main(String[] args) throws Exception {
printArbitraryStrings("a");
System.out.println("====================");
printArbitraryStrings("a", "b");
System.out.println("====================");
printArbitraryStrings("a", "b", "c");
}
}
String 0: a
====================
String 0: a
String 1: b
====================
String 0: a
String 1: b
String 2: c
댓글남기기