exam questions

Exam 2V0-72.22 All Questions

View all questions & answers for the 2V0-72.22 exam

Exam 2V0-72.22 topic 1 question 32 discussion

Actual exam question from VMware's 2V0-72.22
Question #: 32
Topic #: 1
[All 2V0-72.22 Questions]

Refer to the exhibit.

It is a Java code fragment from a Spring application. Which statement is true with regard to the above example? (Choose the best answer.)

  • A. This syntax is invalid because the result of the getBean() method call should be cast to ClientService.
  • B. It will return a bean called ClientService regardless of its id or name.
  • C. This syntax is invalid because the bean id must be specified as a method parameter.
  • D. It will return a bean of the type ClientService regardless of its id or name.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
quakquak3
1 month, 1 week ago
Selected Answer: D
The bean is requested by type and no casting is necessary
upvoted 1 times
...
Azuni
5 months, 1 week ago
The answer is correct. Just remember though that you can fetch it with bean name, class or both (which was a surprise to me). https://www.baeldung.com/spring-getbean#3-retrieving-bean-by-type
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago