Home  >  Forum  >  Spring
Post New Query

How spring loads Class and creates object


joined on
November 09,2013
Asked on March 23,2014
Suppose we have a bean declaration in Spring as below.

<bean id="ob" class="com.test.MyClass"/> 

Can anyone explain, how spring loads MyClass and creates object?
joined on
October 10,2013
Replied on April 03,2014

Spring loads class using custom class loader.

Spring reads the xml and get the fully qualified class name. 
It creates the Object instance as given in example. But to  get instance of the our class,
that class must have an interface and then typecast Object instance by our Interface and you will get the instance of object as discussed in the below link




Write Answer








Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us