title: Methods of Autowiring in Spring - Difference between the two possible alternatives below
body: <p>I have a basic Auto-wiring Question. I see the following two implementations that are possible in Spring auto-wiring</p>
  
  <p><strong>Method1</strong></p>
  
  <pre><code>public class SimpleMovieLister {
  
  private MovieFinder movieFinder;
  
  @Autowired
  public void setMovieFinder(MovieFinder movieFinder) {
      this.movieFinder = movieFinder;
  }
  // ...
  }
  </code></pre>
  
  <p><strong>Method2</strong></p>
  
  <pre><code>public class SimpleMovieLister {
  
  @Autowired
  private MovieFinder movieFinder;
  }
  </code></pre>
  
  <p>My understanding is that both are the same and I use a lot of Method2 in my code. What are the situations in which Method1 is useful ? Or is it just a case of Spring evolution and we have both possible ways in which to  implement. </p>
  
  <p>Sorry, if the question is too basic, but I need to get this cleared up</p>