Title: Top Spring Interview Question & Answer
1Top Spring Interview Questions and Answers
2Question 1 What is Spring?
- Answer
- It is a lightweight, loosely coupled and
integrated framework for developing enterprise
applications in java.
3Question 2 What are the advantages of spring
framework?
- Answer
- Predefined Templates
- Loose Coupling
- Easy to test
- Lightweight
- Fast Development
- Powerful Abstraction
- Declarative support
4Question 3 What are the modules of spring
framework?
- Answer
- Test
- Spring Core Container
- AOP, Aspects and Instrumentation
- Data Access/Integration
- Web
5Question 4 What are the types of Dependency
Injection Spring supports?
- Answer
- Setter Injection Setter-based DI is realized by
calling setter methods on your beans after
invoking a no-argument constructor or no-argument
static factory method to instantiate your bean. - Constructor Injection Constructor-based DI is
realized by invoking a constructor with a number
of arguments, each representing a collaborator.
6Question 5What is the role of IOC container in
spring?
- Answer
- IOC container is responsible to
- create the instance
- configure the instance, and
- assemble the dependencies
7Question 6 What is BeanFactory?
- Answer
- A BeanFactory is like a factory class that
contains a collection of beans. The BeanFactory
holds Bean Definitions of multiple beans within
itself and then instantiates the bean whenever
asked for by clients. - BeanFactory is able to create associations
between collaborating objects as they are
instantiated. This removes the burden of
configuration from bean itself and the beans
client. - BeanFactory also takes part in the life cycle of
a bean, making calls to custom initialization and
destruction methods.
8Question 7What are the types of IOC container
in spring?
- Answer
- There are two types of IOC containers in spring
framework. - BeanFactory
- ApplicationContext
9Question 8What is the difference between
BeanFactory and ApplicationContext?
- Answer
- BeanFactory is the basic container whereas
ApplicationContext is the advanced container.
ApplicationContext extends the BeanFactory
interface. ApplicationContext provides more
facilities than BeanFactory such as integration
with spring AOP, message resource handling for
i18n etc.
10On demand Training and Talent Assessment Platform
- Spring Online Free Practice Test
https//goo.gl/Rtwey5 - Spring Online Free Interview Question
https//goo.gl/7M1fwz - Spring Online Free Tutorials https//goo.gl/UAHTVw
- Spring Online Free Quiz https//goo.gl/5rLsov