Reputation: 245
@Component
public classA {
@Component
public static classB {
}
@Component
public static classC {
}
}
what will be the order for spring bean creation here?
Upvotes: 2
Views: 905
Reputation: 6952
When scanning classes Spring will check for dependencies to determine creation order. ClassB
and ClassC
will get created before ClassA
but which of the other two classes will get created first is unspecified, unless one of them also has a dependency on the other.
Upvotes: 2