Exam 2v0-7222 All QuestionsBrowse all questions from this exam
Question 41

Refer to the exhibit.

What is the id/name of the declared bean in this Java configuration class? (Choose the best answer.)

    Correct Answer: C

    In Java configuration classes, the id or name of the declared bean is derived from the name of the method defining the bean. In this case, the method name is 'clientService'. Therefore, the correct id/name of the bean will be 'clientService' with a lowercase 'c'.

Discussion
Tolo01Option: C

C is the best answer

zakupowerOption: C

id in this case is taken from the method name, also even when Component Scanning is creating beans it decapitalizes the name of the class. To get a bean with capital first letter you need to specify the name yourself.