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

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -