title: Cast to Implemented Class
body: <p>So, I'm working in Java, Trying to cast a <code>java.sql.ResultSet</code> to my own class <code>MyResultSet</code></p>
  
  <p>Here is the code:
  MyResultSet.java</p>
  
  <pre><code>public class MyResultSet implements java.sql.ResultSet{
       //There are a bunch of Implemented Methods here. None of them have any custom code, They are all unchanged. Just didn't want to put huge code in here.
  }
  </code></pre>
  
  <p>The code I'm trying to use to cast it</p>
  
  <pre><code>ResultSet r = getResultSet();
  return (MyResultSet)r;
  </code></pre>
  
  <p>Whenever I run this, I get a "ClassCastException".</p>
  
  <p>Could someone explain to me how to cast to an Implemented Class?..</p>