Springboot MCQs with answers Page - 23

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

Satya • 3.38K Points
Extraordinary

Q. Which annotation marks a class as a service layer component?

  • (A) @Repository
  • (B) @Component
  • (C) @Service
  • (D) @ControllerAdvice

S

Satya • 3.38K Points
Extraordinary

Q. Which dependency is used for JPA in Spring Boot?

  • (A) spring-boot-starter-data-jpa
  • (B) spring-boot-starter-web
  • (C) spring-boot-starter-security
  • (D) spring-boot-starter-cache

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation handles database exceptions translation?

  • (A) @Component
  • (B) @Repository
  • (C) @Controller
  • (D) @Bean

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation is used to define a bean in a Spring Boot configuration class?

  • (A) @Bean
  • (B) @Autowired
  • (C) @Inject
  • (D) @Qualifier

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation is used to handle HTTP POST requests?

  • (A) @PutMapping
  • (B) @DeleteMapping
  • (C) @PostMapping
  • (D) @RequestMapping

S

Satya • 3.38K Points
Extraordinary

Q. What does @ComponentScan do?

  • (A) Scans database tables
  • (B) Scans packages for Spring components
  • (C) Scans HTTP requests
  • (D) Scans HTML files

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation is used to read values from application.properties?

  • (A) @Value
  • (B) @Property
  • (C) @Config
  • (D) @ReadProperty

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation is used to map HTTP PUT requests?

  • (A) @PutMapping
  • (B) @PatchMapping
  • (C) @GetMapping
  • (D) @RequestPut

S

Satya • 3.38K Points
Extraordinary

Q. Spring Boot Actuator is used for?

  • (A) Database creation
  • (B) Monitoring and management of application
  • (C) UI design
  • (D) Compiling code

S

Satya • 3.38K Points
Extraordinary

Q. Which endpoint shows application health in Actuator?

  • (A) /metrics
  • (B) /beans
  • (C) /health
  • (D) /status

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