title: How to remove repeated code in constructors?
body: <p>I have the following code;</p>
  
  <pre><code>abstract class Animal{
  
      public String name;
      public int legCount;
  
      //If has no leg count
      public Animal(String name){
          this.name = name;
          this.legCount = 4;  //Default leg count is 4
  
          System.out.println("Created animal: " + name);
      }
  
      //If has a leg count
      public Animal(String name, int legCount){
          this.name = name;
          this.legCount = legCount;
  
          System.out.println("Created animal: " + name);
      }}
  </code></pre>
  
  <p>I have repeated <strong>System.out.println("Created animal: " + name);</strong> twice. Is there a way to remove this repeated code, so it only runs once? having multiple constructors can make this a bit of a pain.</p>