// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class VarArg {
    public static void p1(String... args) {
        for(String a : args) {
            System.out.println(a);
        }
    }
    public static void p2(String[] args) {
        for(String a : args) {
            System.out.println(a);
        }
    }
    public static void main(String[] args) {
        p1("A");
        p1("A", "B");
        p1("A", "B", "C");
        p2(new String[] { "A" });
        p2(new String[] { "A", "B" });
        p2(new String[] { "A", "B", "C" });
    }
}
