Join Slack
What is the rule for the accessibility of constructor arguments within the `init` block? If there’s ...
# announcements
a
arekolek
03/06/2019, 12:03 PM
What is the rule for the accessibility of constructor arguments within the
init
block? If there’s more than one constructor, you can’t access any arguments? Or is it something different?
d
Dico
03/06/2019, 12:06 PM
Init block has access to the constructor parameters of the main constructor. As do all property initializers.
👍 2
Dico
03/06/2019, 12:07 PM
The main constructor is declared before the { of the class block.
a
arekolek
03/06/2019, 12:08 PM
Thanks
arekolek
03/06/2019, 12:08 PM
It makes sense, since secondary constructors have to call the primary one (if there’s one)
5
Views
Open in Slack
Previous
Next
kotlinlang
A modern programming language that makes developers happier.
Powered by