Springboot MCQs with answers Page - 16

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 of the following annotation is a combination of @Configuration and @EnableAutoConfiguration and @ComponentScan?

  • (A) @SpringComponent
  • (B) @SpringBootApp
  • (C) @SpringBootApplication
  • (D) @AppConfiguration

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What does the spring.datasource.url property define?

  • (A) URL to connect to the cache
  • (B) URL to connect to the database
  • (C) URL to connect to the logging server
  • (D) URL to access frontend app

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation is used to bind a method parameter to the body of a web request?

  • (A) @RequestBody
  • (B) @ModelAttribute
  • (C) @RequestParam
  • (D) @PathVariable

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. How can you exclude a class from being loaded by Spring Boot auto-configuration?

  • (A) @Exclude
  • (B) @EnableExclude
  • (C) @SpringBootApplication(exclude = {...})
  • (D) @NoConfig

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation is used to define a RESTful controller?

  • (A) @RestController
  • (B) @WebService
  • (C) @ServiceController
  • (D) @ApiController

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which of the following starters is used for Thymeleaf template engine?

  • (A) spring-boot-starter-web
  • (B) spring-boot-starter-thymeleaf
  • (C) spring-boot-starter-mustache
  • (D) spring-boot-starter-freemarker

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which tool is commonly used to monitor and manage Spring Boot apps?

  • (A) SpringAdmin
  • (B) Actuator
  • (C) BootMonitor
  • (D) SpringCheck

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. How can you configure a custom banner in Spring Boot?

  • (A) Add banner=true in properties
  • (B) Create banner.png in resources
  • (C) Create a banner.txt file in classpath
  • (D) Add it in application.yml under banner key

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation is used to define properties that must be present in application.properties or application.yml?

  • (A) @Required
  • (B) @ValueRequired
  • (C) @ConfigurationProperties
  • (D) @RequiredArgsConstructor

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. How can you disable a specific actuator endpoint?

  • (A) Use @DisableEndpoint
  • (B) Set management.endpoint.<name>.enabled=false
  • (C) Comment it in application.properties
  • (D) Use @Exclude

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