Here is my sample class with inline comments / questions. Could you advise a better way to deal with this situation?
public abstract class AbstractThreadWithException<TException extends Exception> extends Thread { private TException _exception; public TException getException() { return _exception; }
I assume that it will be possible to transfer the reference to Class<? extends Exception> Class<? extends Exception> , but it seems ugly. Is there a more elegant solution?
Unfortunately, my brain is more tightly connected with thinking in C ++ than thinking in Java, hence the confusion surrounding templates against generics. I think this problem is related to type erasure, but I'm not 100% sure.
source share