Store class HashMap Spring Example
Spring provide many functionality which can be configured and access at run time through beans. Here I will show you how to store classes in HashMap and access it at runtime.
We will use below two classes which will implement same interface:
- Now define bean for it and store in HashMap as below:
You could access HashMap and its classes as below: