Home>IT Tests>Questions>Is the following code valid?
@Configuration
public class MyConfiguration {
@Bean
public MyBean myBean() {
return new MyBean();
}
}
Question from the Spring - Archive test
Is the following code valid? @Configuration public class MyConfiguration { @Bean public MyBean myBean() { return new MyBean(); } }
Medium
Is the default scope of a bean "prototype" ?
Author: Thomas De verdièreStatus: PublishedQuestion passed 8 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!
0
How to create a bean in Spring0
Spring bean scope types0
What is the default class for loading a Spring configuration file?0
Spring IoC and Dependency Injection0
How to inject a dependency in Spring ? With the <property> tag,With the @Autowired annotation,With the <constructor> tag0
What is the purpose of the Spring PropertyPlaceholderConfigurer class?0
Spring configuration with @Value and property tag