title: How to implement the Iterable<> method in a generic class
body: <p>I'm creating a generic class SortedArray that implements Iterable. My big problem is that I'm lost as to what I need to return for this particular method, or for that matter if I'm missing a major step in implementing it. With this current code when I compile it in Unix I'm getting an error stating inconvertible types. Any feedback or information that could put me on my way to fixing this would be much appreciated. Thank you.</p>
  
  <pre><code>public class SortedArray&lt; T extends Comparable&lt; T &gt; &gt;
      extends Object
      implements Iterable &lt; T &gt; {
  
      private T[] internalArray;
      public Iterator&lt;T&gt; iterator() {
          return (Iterator&lt;T&gt;) Arrays.asList(internalArray).iterator();
      }
  }
  </code></pre>