Issue
Is it possible in Spring that a class for bean doesn't have a public constructor but only a private one? Will this private constructor be invoked when the bean is created?
Solution
Yes, Spring can invoke private constructors. If it finds a constructor with the right arguments, regardless of visibility, it will use reflection to set its constructor to be accessible.
Answered By - KevinS
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.