Prev Next

Spring / Spring Beans

Spring bean: difference between stateless and stateful beans.

stateless beans: beans that are singleton and are initialized only once. The only state they have is a shared state. These beans are created while the ApplicationContext is being initialized. The SAME bean instance will be returned/injected during the lifetime of this ApplicationContext. .

stateful beans: beans that can carry state (instance variables). These are created every time an object is required.

It's right time to invest in Cryptocurrencies Dogecoin! Earn free bitcoins up to $250 now by signing up.

Earn bitcoins upto $250 (free), invest in other Cryptocurrencies when you signup with blockfi. Use the referral link: Signup now and earn!

Using BlockFi, don't just buy crypto - start earning on it. Open an interest account with up to 8.6% APY, trade currencies, or borrow money without selling your assets.


Join CoinBase! We'll both receive $10 in free Bitcoin when they buy or sell their first $100 on Coinbase! Available in India also. Use the referral Join coinbase!


Invest now!!! Get Free equity stock (US, UK only)!

Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.

The Robinhood app makes it easy to trade stocks, crypto and more.


Webull! Receive free stock by signing up using the link: Webull signup.

More Related questions...

What are Beans in Spring framework? What does a Spring Bean definition consists of? Different Spring Bean Scope. How do I provide beans configuration metadata to the Spring Container? How do I define the scope of a bean in spring framework? Describe the lifecycle of a Bean in Spring framework. Is a singleton bean thread safe in Spring Framework? Explain the important life-cycle methods of a bean in Spring framework. Explain inner beans in Spring framework? What are the limitations of autowiring in Spring framework? How do I inject java.util.Properties into a Spring Bean? Explain @Required annotation in Spring framework. Explain @autowired annotation in spring framework. How do I make autowired bean property as optional? What is @Resource annotation in Spring framework? How do I configure a bean in my spring application? What kind of exception does spring DAO classes throw? Explain the different ways to configure a Java class as Spring Bean. Difference between id and name attribute of <bean> element in a Spring configuration file. Is Spring Bean with singleton scope thread safe? Difference between @Resource and @Autowired in Spring framework. Explain lazy-init attribute of bean tag in Spring. Can we fetch the inner bean from spring container using its id, if an inner bean defines one? Explain Spring bean inheritance. What is Bean Definition Template in Spring framework? What is spring bean pure inheritance template? Can a spring bean tag with no id or name attribute be created? How do I inject value for a bean property of primitive type? Can spring bean autowire on primitive types? How do I create a stateful bean in Spring framework? Difference between request and prototype bean scope in spring? What is the role of a Spring bean configuration file? Explain Circular Dependency scenario in Spring. Spring Bean marked as abstract by abstract=true needs the corresponding java class be abstract ? Spring Bean: Specify particular implementation of collection in your bean definition. Spring bean: difference between stateless and stateful beans. Can I define spring bean twice with same name in different bean definition file? Can I define spring bean twice with the same bean id in same file? Explain JSR-250 annotation. What is primary annotation in Spring? How to get all the Spring beans implementing a specific interface? What are the attributes of Spring @Transactional annotation? When is a spring bean destroy-method being called? When is a Spring Singleton bean garbage collected? When is a prototype bean garbage collected? Explain BeanPostProcessor beans. Explain no autowiring mode in spring bean. How do you debug Spring configuration? What is component scan in Spring framework?
Show more question and Answers...

Spring Interview questions II

Comments & Discussions