title: Creating new object in abstract class in Java
body: <p>I have two objects which use really similar methods, save for one line. For example:</p>
  
  <pre><code>public class Cat extends Animal
  public class Dog extends Animal
  </code></pre>
  
  <p>And they both use a <code>breed</code> method in the abstract class <code>Animal</code>. One calls <code>new Dog()</code>, and the other <code>new Cat()</code>. Right now I just have it declared as <code>abstract public void breed();</code> in Animal, but is there a way I can generalize it so I don't have to make it an abstract method to be overridden?</p>