Srihitha Technologies

Spring Interview Questions

spring online training

Spring Interview Questions

1Q. What is Spring?
Ans. Spring is a powerful open-source framework for Enterprise Java. Spring Framework can be used in developing any Java application, but there will be extensions for building the web applications on top of the Java EE platform. It targets to make Java EE development easy to use and promote good programming practice through enabling a POJO-based programming model.

2Q. What is a proxy in Spring Framework?
Ans. A proxy is referred to as the creation of an object after applying advice to a particular target object.

3Q. What is a Spring configuration file?
Ans. A Spring configuration file is an XML file that contains the classes information and describes how the classes are configured and linked to each other. The XML configuration files are verbose and cleaner.

4Q. What are the types of IOC containers in spring?
Ans. There are 2 types of IOC Containers in Spring :
1. BeanFactory : It is like a factory class which contains a collection of beans. It instantiates the bean whenever asked for by clients.
2. ApplicationContext: The ApplicationContext interface is built on top of BeanFactory interface. It provides some extra functionality on top BeanFactory.

5Q. What is Spring Security?
Ans. Spring Security is a separate module in the Spring framework which focuses on offering authentication and authorization methods which can be used in Java Applications.

6Q. What does a Spring Bean definition contain?
Ans. A Spring Bean definition contains all the configuration metadata that is needed for the container to know how to create a bean, its lifecycle details, and its dependencies.

7Q. What is an Advice?
Ans. An Action which is taken by an aspect at a particular joinpoint is known as an Advice. Spring AOP uses an advice as an interceptor, maintaining a chain of interceptors “around” the join point.

8Q. What is a JoinPoint?
Ans. A JoinPoint is a point during the execution of a program and it represents the method execution. It includes the execution of a method or handling of an exception.

9Q. Can we inject null and empty string values in Spring?
Ans. Yes, we can inject null and empty string values in Spring.

10Q. Name different types of Bean scopes in Spring framework?
Ans. There are five main types of Bean scopes in Spring framework.
Singleton.
Prototype.
Request.
Session.
Global session.

11Q. When are the target object and proxy objects the same?
Ans. The target objects and proxy objects are same in the case of client objects.

12Q. What do you mean by Aspect?
Ans. Aspect is a modularization of concern which cuts across the multiple objects. Transaction management is an example of a crosscutting concern in J2EE applications. The Aspects are implemented using regular classes or regular classes annotated with @Aspect annotation in Spring Framework.

 

Spring Interview Questions
Exit mobile version