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 } }
To get all Infosys Certified Spring Boot Developer Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee