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

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -