How do add a bean in spring application?

How do add a bean in spring application?

A bean can be added in spring application using :

<beans>
   <bean id=\"foo\" class=\"com.Foo\"/>
   <bean id=\"bar\" class=\"com.Bar\"/>
</beans>


in the Spring configuration file. In the bean tag the id attribute specifies the bean name and the class attribute specifies the fully qualified class name. 

By:Jalees
Date:2031-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher