title: Why specify a method twice - Java
body: <p>I am a python coder but recently started a forey into Java. I am trying to understand a specific piece of code but am running into difficulties which I believe are associated with not knowing Java too well, yet.</p>
  
  <p>Something that stood out to me is that sometimes inside class definitions methods are called twice. I am wondering why that is? For example:</p>
  
  <p>The following code is taken from a file called ApplicationCreator.java. I noticed that the public class ApplicationCreator essentially instantiates itself twice, or am I missing something here? </p>
  
  <pre><code>public class ApplicationCreator&lt;MR&gt; implements
      IResourceObjectCreator&lt;BinaryRuleSet&lt;MR&gt;&gt; {
  
  private String  type;
  
  public ApplicationCreator() {
      this("rule.application");
  }
  
  public ApplicationCreator(String type) {
      this.type = type;
  }
  </code></pre>
  
  <p>So here my questions:</p>
  
  <p>1) Why would the class instantiate itself inside the class?</p>
  
  <p>2) Why would it do so twice? Or is this a way to set certain parameters of the ApplicationCreator class to new values?</p>
  
  <p>Any advice would be highly appreciated.</p>