title: Spring Dependency Injection for Inherited methods
body: <p>Below mentioned is a snippet of a code:-</p>
  
  <pre><code>class A
  {
    protected B()
    {
      int x=5; //line 1
    }
  }
  
  class C extends A
  {
    protected B()
    {
      int x=6; //line 2
    }
  }
  </code></pre>
  
  <p>How can I use spring dependency injection in such a way that only <strong>line 2</strong> will be used in the program and <strong>not line 1</strong> ?</p>