Consider the following code:

@Component("objectComponent1") public class ObjectComponent1 implements ObjectComponent { public String format() { return "Hi"; } } @Component("objectComponent2") public class ObjectComponent2 implements ObjectComponent { public String format() { return "Hello"; } } @Component public class ObjectComponentService { @Autowired private ObjectComponent objComp; } 

What will happen if we try to load ObjectComponentService into a context?

objectComponent1 will be loaded

objectComponent2 will be loaded

NoUniqueBeanDefinitionException is thrown

Either objectComponent1 or objectComponent2 will be loaded

Verified Answer
Correct Option - c

To get all Infosys Certified Cloud Native Developer Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee

Telegram