your options are: 1) Nullable var: `var foo: Stri...
# getting-started
k
your options are: 1) Nullable var:
var foo: String? = null
, then set it in your method 2) lateinit var:
lateinit var foo: String
, then set it in your method. Note that accessing this variable before it's set results in a runtime exception 3) Best option if you don't need any state from your methods: lazy val:
val foo by lazy { computeString() }