I\'m trying to create a singleton object with parameters which are specified by runtime. Example:
object NetworkPusher { val networkAdress = ??? ... } >
Using lazy:
lazy
object Program { var networkAdress: String = _ def main(args: Array[String]): Unit = { networkAdress = args(0) println(NetworkPusher.networkAdress) } object NetworkPusher { lazy val networkAdress = Program.networkAdress } }