Use @Inject to inject dependencies into fields, methods, or constructors. For example:
@Inject
public class MyService { @Inject private Dependency dependency; @Inject public MyService(AnotherDependency anotherDependency) { // constructor code } }
Last updated 8 months ago