About 51 results
Open links in new tab
  1. What is the difference between @Inject and @Autowired in Spring ...

    Here is the piece of code: @Inject private CustomerOrderService customerOrderService; So what is the difference between using @Inject and @Autowired and would appreciate it if someone explained …

  2. java - Using @inject annotation - Stack Overflow

    Mar 7, 2016 · How to inject the dependency of a class in another class, if both of them are in different maven projects. I do not want to use the import statement as adding a import statement means I will …

  3. java - Dependency injection with @Inject - Stack Overflow

    Feb 27, 2021 · In the case of @Inject, some framework that you're using (Spring, CDI, Guice) looks for the annotation and, if present, executes some code that looks up and provides you with the …

  4. javascript - Angular inject () vs DI - Stack Overflow

    May 29, 2025 · Both inject and constructor DI use (almost) the same code path under the hood, so there is no real difference. However, the updated style guide recommends using inject for multiple …

  5. Understanding javax.inject example code? - Stack Overflow

    Aug 8, 2018 · I would very much appreciate someone helping me understand this javax example code and why the @inject annotation is actually useful/what it does. The code below comes from: Code …

  6. inject () must be called from an injection context

    import { Component, OnInit, Inject } from '@angular/core'; constructor( @Inject(MAT_DIALOG_DATA) public data: any, public matDialogRef: MatDialogRef<MatConfirmDialogComponent>) { } inject & …

  7. java - What is the difference between @RequiredArgsConstructor ...

    Sep 6, 2019 · Then you can inject that bean instance to the shop filed of Item class using constructor injection with the help of @RequiredArgsConstructor (onConstructor = @__ (@Inject)) But my …

  8. java - Как работает аннотация @Inject? - Stack Overflow на русском

    Я новичок только учу @Inject. Я не очень понимаю, как он работает. Вот у меня есть поле: @Injection private A a; И я могу использовать в своем коде a, хотя я не писал new. Правильно я …

  9. Explain why constructor inject is better than other options

    Jan 19, 2014 · Explain why constructor inject is better than other options [duplicate] Asked 12 years ago Modified 4 years, 6 months ago Viewed 153k times

  10. Need a simple explanation of the inject method - Stack Overflow

    Apr 2, 2009 · 93 inject takes a value to start with (the 0 in your example), and a block, and it runs that block once for each element of the list. On the first iteration, it passes in the value you provided as …