开发者

Implementing generics for java 1.6

开发者 https://www.devze.com 2022-12-26 10:25 出处:网络
I\'m trying to make this code generic: public final Object unwrap(Class arg0) { throw new UnsupportedOperationException();

I'm trying to make this code generic:

 public final Object unwrap(Class arg0) {
    throw new UnsupportedOperationException();
}

It comes from the Wrapper class (java.sql) and looks originally like th开发者_开发百科is:

<T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException;


public final <T> T unwrap(Class<T> arg0) throws SQLException {
    throw new UnsupportedOperationException();
}

which is exactly the same is the definition you pasted.

0

精彩评论

暂无评论...
验证码 换一张
取 消