I am trying to use global variable in Scala. to be accessible in the whole program .
val numMax: Int = 300
object Foo {.. }
case class Costumer { .. }
case class Client { .. }
object main {
var lst = List[Client]
// I would like to use Client as an object .
}
I got this error :
error: missing arguments for method apply in object List; follow this method with `_' if you want to treat it as a partially applied function var lst = List[A]
How can I deal with Global Variables in Scala to be accessible in the main program . Should I use class or case class in this case ?
Clientobjects? Or do you want to have a single globally accessibleClientinstance that you want to put in a list?