Spring Boot Runners are used to execute a set of code immediately after an application has started. Which of the below are the correct ways for implementing of the Spring Boot Runners? [Choose two]

@SpringBootApplication public class DemoSpringBootApplication implements CommandLineRunner { public static void main(String[] args) { SpringApplication.run(DemoSpringBootApplication.class, args); } @Override public void run(String... args) throws Exception { //code for executing the desired actions to be performed when the application starts } }

@SpringBootApplication public class DemoSpringBootApplication implements ApplicationRunner { public static void main(String[] args) { SpringApplication.run(DemoSpringBootApplication.class, args); } @Override public void run(ApplicationArguments args) throws Exception { //code for executing the desired actions to be performed when the application starts } }

@SpringBootApplication public class DemoSpringBootApplication implements CommandLineRunner { public static void main(String[] args) { SpringApplication.run(DemoSpringBootApplication.class, args); } @Override public void run(ApplicationArguments args) throws Exception { //code for executing the desired actions to be performed when the application starts } }

@SpringBootApplication public class DemoSpringBootApplication implements ApplicationRunner { public static void main(String[] args) { SpringApplication.run(DemoSpringBootApplication.class, args); } @Override public void run(String... args) throws Exception { //code for executing the desired actions to be performed when the application starts } }

Verified Answer
Correct Option - ab

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