kotlin dependency injection
@Component
class Car @Autowired constructor (private val owner: Owner) {
fun getOwner() : Owner {
return owner
}
}
class Owner(private val name: String, private val address: String) {}
kotlin dependency injection
@Component
class Car @Autowired constructor (private val owner: Owner) {
fun getOwner() : Owner {
return owner
}
}
class Owner(private val name: String, private val address: String) {}
kotlin dependency injection
class Bug {
lateinit var desc: String;
lateinit var latestComment: String;
// a setter method so that the Spring container can inject desc and latestComment dependencies
@Autowired
fun updateBug(desc: String, latestComment: String) {
this.desc = desc;
this.latestComment = latestComment;
}
}
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