You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classExampleBean private constructor() {
companionobject {
// a static factory method; the arguments to this method can be// considered the dependencies of the bean that is returned,// regardless of how those arguments are actually used.
@JvmStatic
funcreateInstance(anotherBean:AnotherBean, yetAnotherBean:YetAnotherBean, i:Int): ExampleBean {
val eb =ExampleBean (...)
// some other operations...return eb
}
}
}
The text was updated successfully, but these errors were encountered:
sbrannen
changed the title
Fix Kotlin example for Examples of Dependency Injection
Fix Kotlin example for dependency injection with static factory method
Jun 9, 2022
https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans-some-examples
kotlin changed to:
The text was updated successfully, but these errors were encountered: