Ed Michel
Ed Michel

Reputation: 908

Implementing generics for java 1.6

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 this:

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

Upvotes: 0

Views: 1814

Answers (1)

Bozho
Bozho

Reputation: 597342

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

which is exactly the same is the definition you pasted.

Upvotes: 1

Related Questions