title: Java Dependency Injection with parameters
body: <p>if I have the two classes below
  as we could see this is a constructor injection for SomeBean, however the constructor in SomeBean only has the constructor with parameter &quot;String words&quot;, so during the dependency injection how do we specify the parameter for the constructor of the dependency?</p>
  <pre><code>@Component
  public class SomeBean {
      private String words;
  
      public SomeBean(String words) {
          this.words = words;
      }
  
      public String getWords() {
          return words;
      }
  
      public void setWords(String words) {
          this.words = words;
      }
  
      public void sayHello(){
          System.out.println(this.words);
      }
  }
  
  @Service
  public class MapService {
          private SomeBean someBean;
  
          @Autowired
          public MapService(SomeBean someBean) {
                  this.someBean = someBean;
          }
  
          public MapService() {
  
          }
  
          public void sayHello(){
                  this.someBean.sayHello();
          }
  }
  </code></pre>