score:1

i'm not an expert but @inject annotation is related to a dependency injection framework like guice. guice will initialize a, b and c if it can. imho the problem with most of this frameworks is that they can throw wiring exceptions at runtime (containers are a very dark world :p). try to use, at least if you are learning, the first approach. it will help you to focus on learning language basics and don't fight with a di framework and compiler will help you a lot. i recommend you a di framework for a large projects.


Related Query

More Query from same tag