public class test { public static void foo(String ... args) { System.out.println(args[0]); } public static void main(String[] args) { String[] s = new String[10]; s[0] = new String("foo"); foo(s); } }