Spring Framework

annotations

Given is a class TennisCoach in which you should inject a "FortuneService" implementation via constructor and annotations. Make it constructable by a Spring container.

@Component
public class TennisCoach(){
 
    private FortuneService service;
 
       @Autowired
       public TennisCoach(FortuneService service){
            this.service = service;
       }
 
}

Diskussion