title: Why are the addNode() methods returning the compile error "The method...in type...is not applicable for the arguments...", and how do I fix it?
body: <p>I'm trying to code a generic implementation of a ternary tree, and the tree's addNode method calls the parent node's setLeft, setMiddle, and setRight method, which are defined as follows:</p>
  
  <pre><code>public void setLeft(T item)
      {
          left = new TernaryTreeNode&lt;T&gt;(item);
      }
  </code></pre>
  
  <p>which is called in the addNode method as follows:</p>
  
  <pre><code>currentNode.setLeft(currentNode = new TernaryTreeNode&lt;T&gt;(data));
  </code></pre>
  
  <p>I'm not including the entirety of the code because it won't let me post the question if I do, and that line in the addNode method is where the error is. VSC's telling me that I can't use the child setter methods if I'm using TernaryTreeNode as the argument, but why is that? How do I fix it?</p>