Cast to Implemented Class
问题 So, I'm working in Java, Trying to cast a java.sql.ResultSet to my own class MyResultSet Here is the code: MyResultSet.java 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. } The code I'm trying to use to cast it ResultSet r = getResultSet(); return (MyResultSet)r; Whenever I run this, I get a "ClassCastException". Could someone explain