Which statement is true with regards to the above example? (select one)

Which statement is true with regards to the above example? (select one)

ClientService service = applicationContext.getBean(ClientService.class)
A . It returns the bean called "ClientService"
B . It returns a bean of the type ClientService (regardless of its id or name)
C . This syntax is not valid because the bean id must be specified as a method param
D . This syntax is not valid because the result of the getBean method should be explicitely cast into ClientService

Answer: B

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments