Springboot MCQs with answers Page - 22

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. Spring Boot is mainly used to create?

  • (A) Desktop applications
  • (B) Standalone and microservice-based applications
  • (C) Games
  • (D) Mobile apps only

S

Satya • 3.38K Points
Extraordinary

Q. What is the default embedded server in Spring Boot?

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

S

Satya • 3.38K Points
Extraordinary

Q. Which file is used for configuration in Spring Boot?

  • (A) web.xml
  • (B) application.properties or application.yml
  • (C) config.xml
  • (D) pom.properties

S

Satya • 3.38K Points
Extraordinary

Q. What does @RestController combine?

  • (A) @Controller and @Component
  • (B) @Controller and @ResponseBody
  • (C) @Service and @Repository
  • (D) @Bean and @Configuration

S

Satya • 3.38K Points
Extraordinary

Q. Which dependency is required to create a REST API in Spring Boot?

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

S

Satya • 3.38K Points
Extraordinary

Q. What is the purpose of @Autowired?

  • (A) To configure database
  • (B) To inject dependencies automatically
  • (C) To create a new class
  • (D) To handle exceptions

S

Satya • 3.38K Points
Extraordinary

Q. Which command is used to run a Spring Boot application using Maven?

  • (A) mvn start
  • (B) mvn run
  • (C) mvn spring-boot:run
  • (D) mvn execute

S

Satya • 3.38K Points
Extraordinary

Q. What is Spring Boot Auto-Configuration?

  • (A) Manual configuration by developer
  • (B) Automatic configuration based on dependencies present in classpath
  • (C) Database configuration only
  • (D) Server configuration only

S

Satya • 3.38K Points
Extraordinary

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

  • (A) @GetMapping
  • (B) @PostMapping
  • (C) @RequestController
  • (D) @FetchMapping

S

Satya • 3.38K Points
Extraordinary

Q. What is the default port number of a Spring Boot application?

  • (A) 9090
  • (B) 8080
  • (C) 3306
  • (D) 80

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