Hi,
ich hab ein Verständnisproblem mit Generics und Exceptions. Warum compiliert das hier nicht?
Ich sage doch, dass das die Exception vom Typ E wirft. ???:L
Grüße
Thomas
ich hab ein Verständnisproblem mit Generics und Exceptions. Warum compiliert das hier nicht?
Code:
public abstract class A<E extends Exception> {
public void a() throws E {
}
public void b() throws E {
a();
}
}
unreported exception java.lang.Exception; must be caught or declared to be thrown
a();
^
Ich sage doch, dass das die Exception vom Typ E wirft. ???:L
Grüße
Thomas