• +91 9723535972
  • info@interviewmaterial.com

Spring Interview Questions and Answers

Question -
What do you understand by @Autowired annotation?



Answer -

The @Autowired annotation provides more accurate control over where and how autowiring should be done. This annotation is used to autowire bean on the setter methods, constructor, a property or methods with arbitrary names or multiple arguments. By default, it is a type driven injection.

For Example:

  1. public class Employee
  2. {
  3. private String name;
  4. @Autowired
  5. public void setName(String name)
  6. {this.name=name; }
  7. public string getName()
  8. { return name; }
  9. }

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners