kotlin class constructor
class InitOrderDemo(name: String) {
init {
println("First initializer block that prints ${name}")
}
}
kotlin class constructor
class InitOrderDemo(name: String) {
init {
println("First initializer block that prints ${name}")
}
}
what is the use of secondary constructor in kotlin ?
Although secondary constructors are not that common in Kotlin. The most common use of secondary constructor comes up when you need to extend a class that provides multiple constructors that initialize the class in different ways.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us