constructor - Java - Parameter declaration -


i'm studying piece of code, constructor several parameters. declaration of last parameter ... mean?

    /**  * public constructor.  * @param serviceport service port  * @param nodeaddresses node addresses  * @param sessionaware true if server aware of sessions, false otherwise  * @throws nullpointerexception if given socket-addresses array null  * @throws illegalargumentexception if given service port outside range [0, 0xffff],  *    or given socket-addresses array empty  * @throws ioexception if given port in use, or cannot bound  */ public tcpswitch(final int serviceport, final boolean sessionaware, final inetsocketaddress... nodeaddresses) throws ioexception {     super();     if (nodeaddresses.length == 0) throw new illegalargumentexception();      this.servicesocket = new serversocket(serviceport);     this.executorservice = executors.newcachedthreadpool();     this.nodeaddresses = nodeaddresses;     this.sessionaware = sessionaware;      // start acceptor thread     final thread thread = new thread(this, "tcp-acceptor");     thread.setdaemon(true);     thread.start(); } 

it called varargs, here more http://docs.oracle.com/javase/1.5.0/docs/guide/language/varargs.html

the 3 periods after final parameter's type indicate final argument may passed array or sequence of arguments. varargs can used in final argument position.

as can see in code in case array.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -