Assuming that all the required import statements have been added, find the correct statement to be added in the main method of below code to get the output as "Hello Spring": (Select exactly 2 options)

@Configuration

class SpringConfig {

@Bean(name="StringBean")

public String string() {

return "Hello Spring"; }

}

public class Tester {

public static void main(String[] args) {

ApplicationContext context=new AnnotationConfigApplicationContext(SpringConfig.class);

//Statement to be added

System.out.println(msg);

}

}

String msg = context.getBean(String.class);

String msg = context.getBean("StringBean");

String msg = (String) context.getBean("StringBean");

String msg = (String) context.getBean("string");

Verified Answer
Correct Option - ac

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