During the spring bean initialization if we want to initialize any bean before any other bean we can use depends-on attribute in bean configuration xml.
In the below example class fist is depends on class second so class second should initialize prior to class fist.
Create two java beans (First.java and Second.java)
Update depends-on attribute in spring bean configuration
Create a main class to test bean initialization