What does << mean in Java?

It is varargs

In simple term its an Array of Member like

public setMembers(Member[] members);

When to use:

Generally while designing API it is good to use when number of argument is not fixed.

Example from standard API of this is String.format(String format,Object... args)

Also See

  • var-arg-of-object-arrays-vs-object-array-trying-to-understand-a-scjp-self-test

Check out the Java Language Specification, Third Edition, Chapter 8 (Classes). Buried in there is this nugget:

If the last formal parameter is a variable arity parameter of type T, it is considered to define a formal parameter of type T[]. The method is then a variable arity method. Otherwise, it is a fixed arity method. Invocations of a variable arity method may contain more actual argument expressions than formal parameters. All the actual argument expressions that do not correspond to the formal parameters preceding the variable arity parameter will be evaluated and the results stored into an array that will be passed to the method invocation (§15.12.4.2).

Basically, the last parameter of any method call can have T.... If it has that, it is converted to T[].

So basically, what you have is a fancy way of reproducing the more traditional

String[] args

I believe this was implemented in Java 1.5. The syntax allows you to call a method with a comma separated list of arguments instead of an array.

public static void main(String... args);
main("this", "is", "multiple", "strings");

is the same as:

public static void main(String[] args);
main(new String[] {"this", "is", "multiple", "strings"});

http://today.java.net/article/2004/04/13/java-tech-using-variable-arguments http://download.oracle.com/javase/1.5.0/docs/guide/language/varargs.html