Hey guys! Happy to be here :slightly_smiling_face...
# getting-started
c
Hey guys! Happy to be here 🙂 I have a JavaScript background and finding it difficult understanding the delegation concept as seen in the docs here:
Copy code
class Person(val name: String) {
    constructor(name: String, parent: Person) : this(name) {
        parent.children.add(this)
    }
}
and here:
Copy code
class MyView : View {
    constructor(ctx: Context) : super(ctx)

    constructor(ctx: Context, attrs: AttributeSet) : super(ctx, attrs)
}
Wondering if I could get a clearer description of what happens. Thanks
m
codebeast: yo
you can also use constuctor overloads, like this
constructor(ctx: Context, attrs: AttributeSet = 0) : super(ctx, attrs)
with the annotation @JvmOverloads
k