What is the difference between @inject and @autowired?



What is the difference between @inject and @autowired?..

Answer / Majid Ali Khan

@Inject and @Autowired are both used for dependency injection in Spring Framework, but they are part of different DI frameworks. @Inject comes from CDI (Contexts and Dependency Injection) and is used with Java EE applications, while @Autowired comes from Spring Framework.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Spring Framework Interview Questions

What is context getbean?

1 Answers  


What is meant by rmi?

1 Answers  


Why do we use @override?

1 Answers  


Does spring bean provide thread safety?

1 Answers  


What is the use of @service in spring?

1 Answers  


What are the types of advice?

1 Answers  


What are the types of annotations?

1 Answers  


What do you understand by dependency injection?

1 Answers  


How many types of spring containers are there?

1 Answers  


Why dependency injection is needed?

1 Answers  


What is @resource in spring?

1 Answers  


state the advantages of auto wiring?

1 Answers  


Categories