In the example code, I would recommend listing the secondary constructor (constructor()) BEFORE one of the Init blocks to emphasize that init blocks are called first. Otherwise one might think the secondary constructor is being called in the order it appears in the code (like the other init blocks)
This is the explanation: A class can have more than one init block, in this case, the initializer blocks are executed in the same order as they appear in the class body considering the properties if there are any in between.
I have mentioned: A class can have more than one init block, in this case, the initializer blocks are executed in the same order as they appear in the class body "considering the properties if there are any in between".
Keep Learning, Keep Sharing, and Keep Growing.
In the example code, I would recommend listing the secondary constructor (constructor()) BEFORE one of the Init blocks to emphasize that init blocks are called first. Otherwise one might think the secondary constructor is being called in the order it appears in the code (like the other init blocks)
Good suggestion
Your every videos are helping me getting better in Android. Please create more videos. I would love some videos on coroutines in android.
Keep learning and keep growing. 👍
Superb, keep it up with more vedios like this.
Thanks, I will try my best.
Very good explanation.
Glad to see this comment 😇
Helpful
👍
very well explained 👏
Thank you 🙂
Well explained, Only thing I don't understand is fullName property.
This is the explanation: A class can have more than one init block, in this case, the initializer blocks are executed in the same order as they appear in the class body considering the properties if there are any in between.
@@amitshekhar Thank you for explaining 🙏🏽
Can you please upload basics of kotlin
Thanks for the request. At present, I do not have any plan for it.
But why property fullname called before 2nd init block and 2nd constructor?
I have mentioned: A class can have more than one init block, in this case, the initializer blocks are executed in the same order as they appear in the class body "considering the properties if there are any in between".