wrote:
> Exception [] x = new Exception [10];
>
> x [0] = IllegalMyException;
What is IllegalMyException? It doesn't look like an instanceof Exception.
> public void y () throws x[0]
You can use a fixed number of generic type parameters as exception types
in the exception part of a method declaration.
For instance:
interface Disposable<EXC extends Throwable> {
void dispose() throws EXC;
}
class SQLThing implements Disposable<java.sql.SQLException> {
...
public void dispose() throws java.sql.SQLException {
...
}
}
class NonThrowingThing implements Disposable<java.lang.RuntimeException> {
...
public void dispose() {
...
}
}
Did you have a particular use in mind?
Tom Hawtin