Code example for InvocationTargetException

Methods: getCause

0
  public T newInstance(Object[] args) throws Throwable {
    constructor.setAccessible(true);
    try { 
      return constructor.newInstance(args);
    } catch (InvocationTargetException e) {
      throw e.getCause();
    } 
  } 
   
  @Override 
  public String toString() {
    return constructor.toString();
  } 
} 
Connect your IDE to all the code out there  Get Codota for Java