← Quiz: Roadmap and Maven: all 10 questions
Quiz: Roadmap and Maven · Question 9 of 10
A @Service class is placed in com.example.other while the main class is in com.skills101.courses. What happens?
A @Service class is placed in com.example.other while the main class is in com.skills101.courses. What happens?
- A.Component scanning does not find it, so it is not a bean
- B.It is found because all packages are scanned
- C.The project does not compile
- D.Spring moves the class automatically
Answer & explanation
Correct answer: Component scanning does not find it, so it is not a bean
@SpringBootApplication scans its own package and sub-packages only.
Can you get the rest right without peeking?
Take the timed Quiz: Roadmap and Maven quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →