var initalization at the time of declaration in scala -
i confused following initialization
var in = none: option[fileinputstream]
however know that
var varname : type = _ // default value initialization var varname : type = somevalue // other default intitalization
but
var in = none: option[fileinputstream]
please thanks
// [name] = [value] : [type] var in = none : option[fileinputstream] // can equivalently written as: var in: option[fileinputstream] = none
this creates variable of type option[fileinputstream]
, initial value none
. learn more scala's option
type, see http://www.scala-lang.org/api/current/#scala.option
Comments
Post a Comment