Spring Professional Sample Questions

5 free exam-style questions for the Spring Certified Professional exam (2V0-72.22). Written in-house from the official exam guide. Every option is explained, with links to the Spring docs.

Independent · not affiliated with Broadcom or VMware · every question can be reported

Question 1 / 5

Spring Core · medium difficulty

Question 1 of 5

Based on the default Spring behavior, how many AccountRepository beans will this configuration instantiate?

@Configuration
public class MyConfig {
  @Bean
  public AccountRepository accountRepository() {
    return new JdbcAccountRepository();
  }
  @Bean
  public TransferService transferService() {
    TransferServiceImpl service = new TransferServiceImpl();
    service.setAccountRepository(accountRepository());
    return service;
  }
  @Bean
  public AccountService accountService() {
    return new AccountServiceImpl(accountRepository());
  }
}

Want more questions?

2600+ exam-style questions with explanations like these, timed 60-question mock exams and topic quizzes.