visibility - Scala - how to make val visible -


i have method

def example(something):something {   val c=list()   if(){     if(){       val a=list()     }     else{       val a=list()     }   }   //here or b not declared   c:::a } 

how declare , make visible? i can not use var.

you can't make visible outside declaration scope, so, maybe, try this:

def example(somthing):somthing{       val c = {       if (something) {       (0 10).tolist     } else {       (0 5).tolist     }    } } 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -