Springboot MCQs with answers Page - 4

Here, you will find a collection of MCQ questions on Springboot. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. How can you expose Spring Boot Actuator endpoints?

  • (A) By enabling them in application.properties
  • (B) By calling a Java method
  • (C) By creating a database table
  • (D) By using JNDI configuration

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation is used to scan specified packages for Spring components?

  • (A) @Scan
  • (B) @EnableScan
  • (C) @ComponentScan
  • (D) @PackageScan

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What does @RequestMapping do?

  • (A) Maps a URL to a service
  • (B) Maps a URL to a controller method
  • (C) Maps a class to a configuration
  • (D) Maps a request to a bean

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which file allows customizing embedded server properties?

  • (A) server.xml
  • (B) application.properties
  • (C) web.xml
  • (D) pom.xml

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What does @GetMapping do?

  • (A) Maps HTTP POST requests
  • (B) Maps HTTP GET requests
  • (C) Maps HTTP DELETE requests
  • (D) Maps HTTP PUT requests

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What is the role of @Entity annotation?

  • (A) Defines a REST endpoint
  • (B) Marks a class as a database entity
  • (C) Marks a method as scheduled
  • (D) Creates a Spring service

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which dependency is needed for Spring Data JPA?

  • (A) spring-boot-starter-jdbc
  • (B) spring-boot-starter-web
  • (C) spring-boot-starter-data-jpa
  • (D) spring-boot-starter-data-mongo

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation is used to declare a repository in Spring Boot?

  • (A) @Repository
  • (B) @DAO
  • (C) @Storage
  • (D) @Component

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation is used to enable JPA repositories?

  • (A) @EnableJpaRepositories
  • (B) @EnableRepositories
  • (C) @EnableJPA
  • (D) @JpaRepositories

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which interface is used for CRUD operations in Spring Data JPA?

  • (A) JpaOperations
  • (B) CrudOperations
  • (C) JpaRepository
  • (D) CrudRepository