0
0
Spring Bootframework~20 mins

@SpringBootApplication breakdown - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
SpringBootApplication Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What does @SpringBootApplication combine?
The @SpringBootApplication annotation is a shortcut for combining multiple annotations. Which three annotations does it combine?
A@Controller, @Service, @Repository
B@Bean, @Autowired, @Qualifier
C@Configuration, @EnableAutoConfiguration, @ComponentScan
D@Entity, @Table, @Id
Attempts:
2 left
💡 Hint
Think about annotations that configure, scan components, and enable automatic setup.
component_behavior
intermediate
2:00remaining
How does @SpringBootApplication affect component scanning?
Given a Spring Boot application with @SpringBootApplication on the main class in package com.example.app, which packages will Spring scan for components by default?
AAll packages in the project regardless of location
BOnly <code>com.example.app</code> and its subpackages
COnly the exact package where the main class is located
DOnly <code>com.example</code> and its subpackages
Attempts:
2 left
💡 Hint
Think about where the main class is and how component scanning works by default.
📝 Syntax
advanced
2:00remaining
Identify the syntax error in this Spring Boot main class
What is the syntax error in this Spring Boot main class code snippet?
Spring Boot
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class MyApp {
    public static void main(String[] args) {
        SpringApplication.run(MyApp.class, args);
    }
}
AMissing comma between MyApp.class and args in SpringApplication.run()
BMissing @ComponentScan annotation
CClass name should be lowercase
DMissing public modifier on main method
Attempts:
2 left
💡 Hint
Look carefully at the method call inside main.
lifecycle
advanced
2:00remaining
What happens during Spring Boot application startup with @SpringBootApplication?
Which of the following best describes what happens when a Spring Boot application annotated with @SpringBootApplication starts?
AOnly scans components but does not configure beans automatically
BRuns the application without scanning or configuring anything
CStarts the server but requires manual bean configuration
DSpring Boot auto-configures beans, scans components, and starts the embedded server
Attempts:
2 left
💡 Hint
Remember what auto-configuration and component scanning do.
🔧 Debug
expert
3:00remaining
Why does a Spring Boot app fail to start with @SpringBootApplication?
You have a Spring Boot app with @SpringBootApplication on the main class. The app fails to start with a 'No qualifying bean' error for a service. What is the most likely cause?
AThe service class is outside the main class package and not scanned
BThe main class is missing the @EnableAutoConfiguration annotation
CThe application.properties file is missing
DThe main method is not static
Attempts:
2 left
💡 Hint
Think about component scanning and package structure.