I am trying to create a function that throws an exception based on the type that you pass in.
private void myFunc(Class<?> exceptionType) {
...do some work...
throw new exceptionOfTypeExceptionTypePassedIn(newMessage);
}
Can you do this?
Aucun commentaire:
Enregistrer un commentaire