Additional Exercises for Mastering Spring Framework 5 Essentials

These are additional exercises you can try out once after learning and practicing all the previous exercises in this section. There will be also hints to make things easier.

  1. Provide examples for autowire for type and autowire by constructor.

  2. Rewrite the following programming using annotations and java configuration:

  3. Give examples for the usage of following annotations following the same example program in this section: @Autowired, @Resource, @Inject.

  4. What will happen if I change a @Autowired annotation in previous examples within the section with @Resource or @Inject?

  5. Write a program that will fail without @Qualifier, but will pass once using @Qualifier.

  6. Write a program that will fail without @Primary, but will pass once using @Primary.

  7. Print the bean definition count and the bean definition names for the following programs from within the main program and compare:

  8. Rewrite this program using XML configuration:



  • You can submit your solutions for review and better ones may get added to the current section of notes. You will receive 500 points for every accepted solution that feature on this site. 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within!!!