Spring Boot MCQ Questions and Answers | Set 7


Welcome to Set 7 of our 100+ Spring Boot MCQ Questions and Answers series. This Set 7 continues from MCQs 61-70 and covers Spring Boot and Spring annotations.

Complete Spring Boot MCQ Questions and Answers series:

Spring Boot MCQ Questions and Answers | Set 1

Spring Boot MCQ Questions and Answers | Set 2

Spring Boot MCQ Questions and Answers | Set 3

Spring Boot MCQ Questions and Answers | Set 4

Spring Boot MCQ Questions and Answers | Set 5

Spring Boot MCQ Questions and Answers | Set 6

Spring Boot MCQ Questions and Answers | Set 7

Spring Boot MCQ Questions and Answers | Set 8

Spring Boot MCQ Questions and Answers | Set 9

Spring Boot MCQ Questions and Answers | Set 10

61. In Spring Boot, which annotation is used to create asynchronous methods?

a) @Async
b) @Scheduled
c) @EnableAsync
d) @AsyncMethod

62. What is the primary purpose of the @EnableJpaAuditing annotation in Spring Boot?

a) To enable JPA repository support
b) To configure application security
c) To enable auditing in JPA entities
d) To enable Aspect-Oriented Programming

63. How does Spring Boot support OAuth2 for securing applications?

a) By using the spring-boot-starter-oauth2-client dependency
b) Through the manual configuration of OAuth2 providers
c) By requiring a separate authentication server
d) Through XML configuration

64. In Spring Boot, what is the purpose of the @ExceptionHandler annotation?

a) To handle exceptions within a specific controller
b) To configure application security
c) To define scheduled tasks
d) To enable Aspect-Oriented Programming

65. What is the primary use of the @Transactional annotation in Spring Boot?

a) To enable batch processing
b) To configure application properties
c) To manage transactions declaratively
d) To enable WebSocket functionality

66. How does Spring Boot simplify the deployment of web applications?

a) By requiring a dedicated application server
b) By embedding servlet containers like Tomcat or Jetty
c) Through manual configuration of deployment settings
d) By using a specialized deployment tool

67. What is the primary role of the @RestController annotation in Spring Boot?

a) To define a scheduled task
b) To create a batch job
c) To define a web controller that returns a RESTful web service
d) To enable WebSocket functionality

68. How does Spring Boot simplify the development of web applications?

a) By automatically configuring Spring MVC
b) By requiring manual configuration for each web component
c) By integrating third-party web frameworks
d) By using a purely annotation-based approach

69. What is the function of the @RequestMapping annotation in Spring Boot?

a) To define a scheduler
b) To map web requests to handler methods in controller classes
c) To manage transactions
d) To configure security settings

70. What is the purpose of the @ResponseBody annotation in a Spring Boot controller?

a) To bind method parameters to named model attributes
b) To enable WebSocket functionality
c) To send the returned object as the response body
d) To handle form submissions


Comments

Spring Boot 3 Paid Course Published for Free
on my Java Guides YouTube Channel

Subscribe to my YouTube Channel (165K+ subscribers):
Java Guides Channel

Top 10 My Udemy Courses with Huge Discount:
Udemy Courses - Ramesh Fadatare