Upload
jasmeet-kaur
View
24
Download
0
Embed Size (px)
Citation preview
Hub4TechTop Spring Interview Questions and Answers
Answer:It is a lightweight, loosely coupled and integrated framework for developing enterprise applications in java.
Question: 1 What is Spring?
Answer:• Predefined Templates• Loose Coupling• Easy to test• Lightweight• Fast Development• Powerful Abstraction• Declarative support
Question: 2 What are the advantages of spring framework?
Answer:• Test• Spring Core Container• AOP, Aspects and Instrumentation• Data Access/Integration• Web
Question: 3 What are the modules of spring framework?
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?
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?
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?
Answer:• There are two types of IOC containers in spring framework.• BeanFactory• ApplicationContext
Question: 7What are the types of IOC container in spring?
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?
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