Computer Science, asked by sharfraz7270, 1 year ago

Difference between @resource and @autowired

Answers

Answered by AloneButHappy
1
01) @resource means get me a known resource by name. The name is extracted from name of annoted setter or field
@autowired try to wire in a suitable other components by type
02) @resource allows you to specify a name of injected bean
@autowired allows you to mark it as non - mandatory
03) @autowired is a spring annotations whereas
@resource is specified by the JSR - 250 as you pointed out yourself. So later is part of Java whereas the former is spring specific.
Hope it helps you!
## If it is helpful for you then plz marks as brainliest. ##
Similar questions