@Autowired, @Resource and @Inject
- 8th Sep 2014
- 4
- 27454
- Autowiring in springs How @autowired works How @Inject works How @Resource works
Let us understand @Autowired,@Resource and @Inject All these annotations are used to inject dependent objects in spring. Lets see what is their differences @Resource -> javax.annotation @Inject -> javax.inject @Autowired -> org.springframework.beans.factory.annotation Let’s start with the below example Create Vehicle.java package com.kb.autowire_resource_inject; public interface Vehicle { } package com.kb.autowire_resource_inject; public interface Vehicle { […]