Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

VMware Exam 2V0-72.22 Topic 9 Question 71 Discussion

Actual exam question for VMware's 2V0-72.22 exam
Question #: 71
Topic #: 9
[All 2V0-72.22 Questions]

Refer to the exhibit.

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

Show Suggested Answer Hide Answer
Suggested Answer: C

This is true because the id/name of a bean declared by the @Bean annotation is derived from the name of the method that returns the bean. In this case, the method name is clientService, so the bean name will be clientService as well. By default, Spring uses a lower-case first letter for bean names, unless explicitly specified otherwise by using the name attribute of the @Bean annotation. For example, we can use @Bean(name = ''ClientService'') to change the bean name to ClientService (starting with uppercase ''C'').


Contribute your Thoughts:

Bernardo
2 days ago
Hold up, are we sure this isn't a trick question? I mean, who knows, maybe the correct answer is 'BeanOfDoom' or something equally bizarre.
upvoted 0 times
...
Tamra
3 days ago
Hmm, this is a tricky one. I'm going to go with option C. It just feels more natural to me, you know?
upvoted 0 times
...
Adelina
8 days ago
I think option B is the right answer. The naming convention for beans is camelCase, so ClientServiceImpl is the way to go.
upvoted 0 times
...
Cyril
15 days ago
But the convention is to start bean names with lowercase, so it should be clientServiceImpl.
upvoted 0 times
...
Johnetta
18 days ago
I disagree, I believe it is ClientService (starting with uppercase 'C').
upvoted 0 times
...
Daren
19 days ago
The answer is clearly option D. The name of the declared bean should start with an uppercase letter, so ClientService is the correct choice.
upvoted 0 times
...
Cyril
29 days ago
I think the id/name of the declared bean is clientServiceImpl (starting with lowercase 'c').
upvoted 0 times
...

Save Cancel