title: In Java How to Input an object defined as Its Interface as argument
body: <p>i have an interface position</p>
  <pre><code>public interface Position&lt;E&gt; 
  </code></pre>
  <p>and a class node that implements position</p>
  <pre><code>protected static class Node&lt;E&gt; implements Position&lt;E&gt;
  </code></pre>
  <p>i have a function Traversal that takes Node n as argument</p>
  <pre><code>public Position&lt;E&gt; Traversal(Node&lt;E&gt; n){...}
  </code></pre>
  <p>now i try to pass <code>Position&lt;String&gt; n</code> to Traversal as an argument</p>
  <pre><code>System.out.println(Traversal(n));
  </code></pre>
  <p>and get the error</p>
  <pre><code> Traversal(Node&lt;E&gt;) is not applicable for the arguments (Position&lt;String&gt;)
  </code></pre>
  <p>I can't change</p>
  <pre><code>Position&lt;E&gt; Traversal(Node&lt;E&gt; n)
  </code></pre>
  <p>to</p>
  <pre><code>Position&lt;E&gt; Traversal(Position&lt;E&gt; n)
  </code></pre>
  <p>since I need to use methods in the Node class not defined in the position interface.
  So how can I resolve this error?</p>