https://kotlinlang.org logo
#announcements
Title
# announcements
r

rook

10/16/2017, 8:55 PM
so, if I have a Java class with three constructors that I’m extending, is there a way to call a different
super
constructor based on the parameters supplied?
r

radityagumay

10/17/2017, 1:00 AM
You can use @jvmoverload
for example
Copy code
class CustomView @JvmOverload constructor(
      context: Context,
      attr: AttributeSet? = null,
      defStyle : Int = 0) : LinearLayout(context, attr, defstyle) {

     init {}
}
3 Views