Solved

Two Beans of Type MyBean Are Defined in the ApplicationContext

Question 8

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents