I want to create a singleton object for my application , but i want to initialize it from another object.
For ex :
object A{
val x = 10
val b = B(x)
}
object B(y:Int){
var z = y
}
But this would not work , since object doesnt have constructor. I need to initialize object from another object since val x (in above example) would be known at runtime.
Any workaround for this?