Spring Boot Interview Questions and Answers
Intermediate / 1 to 5 years experienced level questions & answers
Ques 1. How can you change JDK version in Spring Boot?
<properties>
<java.version>11</java.version>
</properties>
Ques 2. What is Spring Boot starter? How is it useful?
Ques 3. How can you access a value defined in the application? What is properties file in Spring Boot?
@Value(”${custom.value}”)private String customVal;
Ques 4. What is the primary difference between Spring and Spring Boot?
Spring is a web application development framework based on Java. On the other hand Spring Boot is an extension of the spring framework which eliminated the boilerplate configuration required for setup a Spring application.
Ques 5. How can you connect Spring Boot to the database using JPA?
Spring Boot supports spring-boot-starter-data-jpa, which helps you to connect spring application with a relational database.
Ques 6. What is the main difference between JPA and Hibernate?
The main difference between both of them is that JPA is a specification/Interface, whereas Hibernate is only JPA implementations.
Ques 7. What are Spring Boot Starter Projects?
Starters in Spring Boot are a set of convenient descriptors that are included in Spring Boot applications. It comes with a variety of Spring-related technology which makes the entire process of the application development much easier.
Ques 8. What is @pathVariable?
@PathVariable annotation helps you to extract information from the URI directly.
Ques 9. How to scan all the beans and package declarations in Spring Boot?
Most helpful rated by users:
- What is Spring Boot?
- How to scan all the beans and package declarations in Spring Boot?
- What are embedded containers support by Spring?
- What are the advantages of microservice?