mzgreen
07/21/2017, 1:30 PMclass A {
var b = B()
}
class B {
var value = 5
}
let a: A? = A()
let foo = a?.b.value // I don't have to put ? after b and whole expression has Int type
In Kotlin I would have to do val foo = a?.b?.value
and the whole expression would be an Int?
. Is any of these approaches better? And why if so?