java - What does the points stand for? -


when write constructor in java this:

import java.io.ioexception; import java.io.outputstream;  public class multioutputstream extends outputstream{      outputstream[] ostream;      public multioutputstream(outputstream ostream) {          this.ostream = ostream;         // todo auto-generated constructor stub     }      @override     public void write(int arg0) throws ioexception {         // todo auto-generated method stub      } } 

eclipse says: type mismatch: cannot convert outputstream outputstream[]. eclipse corrected constructor this:

import java.io.ioexception; import java.io.outputstream;  public class multioutputstream extends outputstream{      outputstream[] ostream;      public multioutputstream(outputstream... ostream) {         this.ostream = ostream;         // todo auto-generated constructor stub     }      @override     public void write(int arg0) throws ioexception {         // todo auto-generated method stub      }  } 

what these points stand for?

thanks in advance!

they called "varargs", see http://docs.oracle.com/javase/7/docs/technotes/guides/language/varargs.html.

the 3 periods after final parameter's type indicate final argument may passed array or sequence of arguments.


Comments

Popular posts from this blog

how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -

javascript - Create websocket without connecting -

sharepoint - Accessing files across a shared directory using a Windows service -