Consider the below given code snippet, choose the correct statement from the following. [Assume all the necessary imports are done].

@SpringBootApplication

public class DemoSpringBootApplication {

public static void main (String[] args) {

SpringApplication.run(DemoSpringBootApplication.class, args);

}

@Bean

public CustomerServiceImpl customerService() {

return new CustomerServiceImpl();

}

}

@Bean definition cannot be added in starter class , should be added in configuration class

@Configuration annotation is missing on the DemoSpringBootApplication class

Given code can execute successfully and creates a spring bean

Bean name should be provided to avoid runtime exception

Verified Answer
Correct Option - c

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

Telegram

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in

Updated on Tue, 21 Oct 2025