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

Correct Option - c

To get all Infosys Certified Spring Boot Developer Exam questions Join Group https://bit.ly/infy_premium_group

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