Short answer
All four are stereotype specializations of @Component and are equally picked up by component scanning, so functionally they mostly just document intent.
Explanation
The real exception is @Repository: it enables persistence exception translation, converting vendor-specific SQLExceptions into Spring's unchecked DataAccessException hierarchy via a PersistenceExceptionTranslationPostProcessor. @Controller/@RestController are recognized by Spring MVC's handler mapping. Using the precise stereotype also lets AOP pointcuts and tooling target layers cleanly.
Common mistakes
- Saying the four annotations are completely identical.
- Not knowing @Repository adds exception translation.