Solved

Two Beans of Type MyBean Are Defined in the ApplicationContext

Question 28

Multiple Choice

Two beans of type MyBean are defined in the ApplicationContext with singleton scope, with ids "myBean1" and "myBean2". The getBean() method is called once for each bean. Which statement is true about the two references returned? (Select one)


A) The two references refer to different instances of the same type
B) Both references refer to the same bean instance
C) One of the references will be null
D) A RuntimeException will be thrown when the ApplicationContext is initialized

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions