The following list provides some Spring Boot Practice Questions and Their Solutions.
Application Based Spring Boot Practice Questions and Their Solutions
- Develop a simple Spring Boot application that displays ‘Welcome to programmingempire.com’.
- Demonstrate the use of Dependency Injection and auto-wired with Spring Boot. For this purpose, create an application involving the three classes – Regular Faculty, Visiting Faculty, and Adhoc Faculty. Also, create a class faculty that serves as the superclass of these three classes.
- In order to create a login application, use Spring Boot MVC. When the user enters the username as ‘firstname.lastname@example.org’ and the password as ‘programmingempire@abcd123’, the control should transfer to the page HomePage.jsp. Otherwise, the control should transfer to the ErrorPage.jsp.
- Create an application ‘Library Management System’ using Spring Boot MVC. Also, demonstrate the use of JPA (Java Persistence API), and H2 database.
- Create a REST service using Spring Boot.
Theoretical Spring Boot Practice Questions and Their Solutions
- What is Spring Boot?
- When do we use Spring Boot?
- What are the advantages of using Spring Boot over Spring framework.
- Compare Spring and Spring Boot.
- The following list contains some of the Spring Boot annotations: @Controller, @Component, @AutoWired, @ReuestMapping, @Service, @Component. Explain them. Hint. Basically, annotations represent metadata. So, they provide additional information about the program. For instance, @Component marks a Java class or Java Bean.
- When do we use JPA?
- What is H2 database? When do we use it?
- Discuss Spring Boot Query Methods.
Java Practice Exercise