Springboot MCQs with answers Page - 6

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. What does the 'spring.datasource.url' property define?

  • (A) The path to the application's resources
  • (B) The URL for the Spring website
  • (C) The JDBC URL of the database
  • (D) The endpoint for REST API

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What is the use of CommandLineRunner interface?

  • (A) To configure database
  • (B) To execute code after Spring Boot app starts
  • (C) To create custom annotations
  • (D) To register filters

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation is used to define a RESTful path variable?

  • (A) @PathParam
  • (B) @Var
  • (C) @PathVariable
  • (D) @Param

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation is used to map request parameters in Spring Boot?

  • (A) @RequestAttribute
  • (B) @RequestParam
  • (C) @Param
  • (D) @PathParam

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which of the following is a correct way to shut down a Spring Boot app?

  • (A) By deleting application.yml
  • (B) By calling SpringApplication.exit()
  • (C) By removing @SpringBootApplication
  • (D) By throwing an exception

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which library does Spring Boot use for JSON processing by default?

  • (A) Gson
  • (B) Jackson
  • (C) FastJSON
  • (D) JSON.simple

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What is the purpose of @RequestBody annotation?

  • (A) To inject a service
  • (B) To bind the request body to a method parameter
  • (C) To return an HTTP header
  • (D) To validate a request

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation is used to apply validation rules to a model?

  • (A) @Valid
  • (B) @Validated
  • (C) @Validator
  • (D) @ValueCheck

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which embedded server does Spring Boot use by default?

  • (A) Jetty
  • (B) Tomcat
  • (C) GlassFish
  • (D) Undertow

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What does @CrossOrigin annotation do?

  • (A) Enables caching
  • (B) Configures SSL
  • (C) Allows cross-origin requests
  • (D) Enables file upload

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