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

Popular posts from this blog

cron - how to properly run Python script with crontab on every system startup -

elasticsearch - Is the order of operations guaranteed in a bulk update? -

Slow performance first queries on SQL Azure -