Springboot MCQs with answers Page - 3

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 annotation is used to create a REST endpoint in Spring Boot?

  • (A) @Controller
  • (B) @Service
  • (C) @RestController
  • (D) @Repository

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What is the default logging framework used in Spring Boot?

  • (A) Log4j
  • (B) Logback
  • (C) Commons Logging
  • (D) SLF4J

S

Shyam Dubey • 3.70K Points
Extraordinary

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

  • (A) @Autowired
  • (B) @Value
  • (C) @Inject
  • (D) @ConfigProperty

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What does the @Component annotation do?

  • (A) Marks a class as a Spring Boot application
  • (B) Creates a bean for database access
  • (C) Marks a class as a Spring-managed component
  • (D) Loads application.properties

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which tool can be used to create a Spring Boot project?

  • (A) Spring Initializr
  • (B) Spring Generator
  • (C) Spring Creator
  • (D) Spring Designer

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. How do you enable scheduling in a Spring Boot application?

  • (A) Using @EnableScheduling
  • (B) Using @EnableAsync
  • (C) Using @ScheduledConfig
  • (D) Using @EnableTimer

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation is used to define a scheduled task?

  • (A) @Async
  • (B) @Cron
  • (C) @Scheduled
  • (D) @Task

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which starter is used to connect to a MySQL database?

  • (A) spring-boot-starter-data-jdbc
  • (B) spring-boot-starter-data-mysql
  • (C) spring-boot-starter-data-jpa
  • (D) spring-boot-starter-jdbc

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation is used for unit testing Spring Boot components?

  • (A) @SpringTest
  • (B) @SpringBootTest
  • (C) @TestComponent
  • (D) @BootTest

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which class is used to launch a Spring Boot application?

  • (A) SpringApplication
  • (B) SpringBootLauncher
  • (C) ApplicationRunner
  • (D) BootApp

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