title: java how expensive is a method call
body: <p>I'm a beginner and I've always read that it's bad to repeat code. However, it seems that in order to not do so, you would have to have extra method calls usually. Let's say I have the following class</p>
  
  <pre><code>public class BinarySearchTree&lt;E extends Comparable&lt;E&gt;&gt;{
      private BinaryTree&lt;E&gt; root;
      private final BinaryTree&lt;E&gt; EMPTY = new BinaryTree&lt;E&gt;();
      private int count;
      private Comparator&lt;E&gt; ordering;
  
      public BinarySearchTree(Comparator&lt;E&gt; order){
          ordering = order;
          clear();
      }
  
      public void clear(){
          root = EMPTY;
          count = 0;
      }
  }
  </code></pre>
  
  <p>Would it be more optimal for me to just copy and paste the two lines in my clear() method into the constructor instead of calling the actual method? If so how much of a difference does it make? What if my constructor made 10 method calls with each one simply setting an instance variable to a value? What's the best programming practice?</p>