• +91 9723535972
  • info@interviewmaterial.com

Spring Interview Questions and Answers

Spring Interview Questions and Answers

Question - 31 : - What Are the Disadvantages of Using Reactive Streams?

Answer - 31 : -

There are some major disadvantages to using reactive streams:

  • Troubleshooting a Reactive application is a bit difficult, so be sure to check out our tutorial on debugging reactive streams for some handy debugging tips.
  • There is limited support for reactive data stores since traditional relational data stores have yet to embrace the reactive paradigm.
  • There's an extra learning curve when implementing.

Question - 32 : -
Is Spring 5 Compatible With Older Versions of Java?

Answer - 32 : -

In order to take advantage of Java 8 features, the Spring codebase has been revamped. This means older versions of Java cannot be used. So, the framework requires a minimum of Java 8.

Question - 33 : - What is a Spring Framework?

Answer - 33 : -

  • Spring is a powerful open source, application framework created to reduce the complexity of enterprise application development.
  • It is light-weighted and loosely coupled.
  • It has layered architecture, which allows you to select the components to use, while also providing a cohesive framework for J2EE application development.
  • Spring framework is also called the framework of frameworks as it provides support to various other frameworks such as Struts, Hibernate, Tapestry, EJB, JSF etc.

Question - 34 : - List the advantages of Spring Framework.

Answer - 34 : -

  • Because of Spring Frameworks layered architecture, you can use what you need and leave which you don’t.
  • Spring Framework enables POJO (Plain Old Java Object) Programming which in turn enables continuous integration and testability.
  • JDBC is simplified due to Dependency Injection and Inversion of Control.
  • It is open-source and has no vendor lock-in.

Question - 35 : - What are the different features of Spring Framework?

Answer - 35 : -

Following are some of the major features of Spring Framework :

  • Lightweight: Spring is lightweight when it comes to size and transparency. 
  • Inversion of control (IOC): The objects give their dependencies instead of creating or looking for dependent objects. This is called Inversion Of Control.
  • Aspect oriented Programming (AOP): Aspect oriented programming in Spring supports cohesive development by separating application business logic from system services.
  • Container: Spring Framework creates and manages the life cycle and configuration of the application objects.
  • MVC Framework: Spring Framework’s MVC web application framework is highly configurable. Other frameworks can also be used easily instead of Spring MVC Framework.
  • Transaction Management: Generic abstraction layer for transaction management is provided by the Spring Framework. Spring’s transaction support can be also used in container less environments.
  • JDBC Exception Handling: The JDBC abstraction layer of the Spring offers an exception hierarchy, which simplifies the error handling strategy.

Question - 36 : - What is a Spring configuration file?

Answer - 36 : -

A Spring configuration file is an XML file. This file mainly contains the classes information. It describes how those classes are configured as well as introduced to each other. The XML configuration files, however, are verbose and more clean. If it’s not planned and written correctly, it becomes very difficult to manage in big projects.

Question - 37 : - What are the different components of a Spring application?

Answer - 37 : -

A Spring application, generally consists of following components:

  • Interface: It defines the functions.
  • Bean class: It contains properties, its setter and getter methods, functions etc.
  • Spring Aspect Oriented Programming (AOP): Provides the functionality of cross-cutting concerns.
  • Bean Configuration File: Contains the information of classes and how to configure them.
  • User program: It uses the function.

Question - 38 : - What are the various ways of using Spring Framework?

Answer - 38 : -

Spring Framework can be used in various ways. They are listed as follows:

  •  As a Full-fledged Spring web application.
  • As a third-party web framework, using Spring Frameworks middle-tier.
  •  For remote usage. 
  • As Enterprise Java Bean which can wrap existing POJOs (Plain Old Java Objects).

Question - 39 : - What is Spring IOC Container?

Answer - 39 : -

At the core of the Spring Framework, lies the Spring container. The container creates the object, wires them together, configures them and manages their complete life cycle. The Spring container makes use of Dependency Injection to manage the components that make up an application. 
              
The container receives instructions for which objects to instantiate, configure, and assemble by reading the configuration metadata provided. This metadata can be provided either by XML, Java annotations or Java code.

Question - 40 : - What do you mean by Dependency Injection?

Answer - 40 : -

In Dependency Injection, you do not have to create your objects but have to describe how they should be created. You don’t connect your components and services together in the code directly, but describe which services are needed by which components in the configuration file. The IoC container will wire them up together.


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners