// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
public class VArg {
    public static void demo(int... v) {
        int n = v.length;
        for(int i = 0; i < n; i++) {
            int v1 = v[i];
            System.out.printf(" %d", v1);
        }
        System.out.printf("\n");
    }
    public static void main(String[] args) throws Exception {
        demo(1);
        demo(1, 2);
        demo(1, 2, 3);
    }
}
