Springboot MCQs with answers Page - 11

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. Which interface can be used to run code after the Spring Boot application starts?

  • (A) Runnable
  • (B) ApplicationRunner
  • (C) SpringRunner
  • (D) BootRunner

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What does the @EnableTransactionManagement annotation do?

  • (A) It disables transactions
  • (B) It enables annotation-driven transaction management
  • (C) It starts a database
  • (D) It handles application startup

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation is used for field validation in Spring Boot?

  • (A) @ValidateThis
  • (B) @FieldCheck
  • (C) @Valid
  • (D) @FieldValidator

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation is used to map an HTTP DELETE request?

  • (A) @DeleteMapping
  • (B) @DeleteRequest
  • (C) @RequestDelete
  • (D) @DeleteHandler

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which dependency is used to test Spring Boot web controllers?

  • (A) spring-boot-starter-web
  • (B) spring-boot-starter-test
  • (C) spring-boot-starter-data-jpa
  • (D) spring-boot-test-controller

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. How do you define custom application properties in Spring Boot?

  • (A) Add them to pom.xml
  • (B) Use @PropertySource
  • (C) Declare them in application.properties or application.yml
  • (D) Add them to Spring Boot dashboard

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What is the default port for a Spring Boot application?

  • (A) 7070
  • (B) 3000
  • (C) 8080
  • (D) 9090

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which command is used to build a Spring Boot application with Maven?

  • (A) mvn package
  • (B) mvn spring-boot
  • (C) mvn compile-boot
  • (D) mvn run-boot

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation allows you to define controller methods that return data instead of views?

  • (A) @RestController
  • (B) @Controller
  • (C) @DataMapping
  • (D) @ResponseData

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation helps bind form data to a JavaBean in Spring MVC?

  • (A) @ModelAttribute
  • (B) @FormBind
  • (C) @FormBean
  • (D) @BindAttribute

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ