https://kotlinlang.org logo
#spring
Title
# spring
g

Gabriel Machado

07/27/2018, 5:10 PM
Is there a recommended modifier for autowired variables?
lateinit var
or a null initialized
val
z

zpearce

07/27/2018, 5:19 PM
You can't change a val once it's initialized
The only way I've seen work is lateinit var (or constructor autowiring with vals, which I like the most)
👍 3
g

Gabriel Machado

07/27/2018, 5:49 PM
Thank you!
s

sdeleuze

07/28/2018, 6:43 AM
Yes constructor autowiring should be the default option even for var
🌟 2
4 Views