10
Hub4Tech Top Spring Inter view Questions a nd Answers

Top spring interview question and answer

Embed Size (px)

Citation preview

Page 2: Top spring interview question and answer

Answer:It is a lightweight, loosely coupled and integrated framework for developing enterprise applications in java.

Question: 1 What is Spring?

Page 3: Top spring interview question and answer

Answer:• Predefined Templates• Loose Coupling• Easy to test• Lightweight• Fast Development• Powerful Abstraction• Declarative support

Question: 2 What are the advantages of spring framework?

Page 4: Top spring interview question and answer

Answer:• Test• Spring Core Container• AOP, Aspects and Instrumentation• Data Access/Integration• Web

Question: 3 What are the modules of spring framework?

Page 5: Top spring interview question and answer

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.

Question: 4 What are the types of Dependency Injection Spring supports?

Page 6: Top spring interview question and answer

Answer:• IOC container is responsible to:• create the instance• configure the instance, and• assemble the dependencies

Question: 5What is the role of IOC container in spring?

Page 7: Top spring interview question and answer

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.

Question: 6 What is BeanFactory?

Page 8: Top spring interview question and answer

Answer:• There are two types of IOC containers in spring framework.• BeanFactory• ApplicationContext

Question: 7What are the types of IOC container in spring?

Page 9: Top spring interview question and answer

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.

Question: 8What is the difference between BeanFactory and ApplicationContext?

Page 10: Top spring interview question and answer

Spring Online Free Practice Test https://goo.gl/Rtwey5Spring Online Free Interview Question https://goo.gl/7M1fwzSpring Online Free Tutorials https://goo.gl/UAHTVwSpring Online Free Quiz https://goo.gl/5rLsov

On demand Training and Talent Assessment Platform