I'm trying to catch InvocationTargetException in my file, but I get this error if I do not explicitly write the import statement for it.
Since it's under a sub package of java.lang, I don't know why I have to import it.
//this is the import statement that worked
import java.lang.reflect.InvocationTargetException;
This is the error message:
source\DatabaseDemo.java:38: error: cannot find symbol
}catch (NoSuchMethodException | InstantiationException | SQLException | ClassNotFoundException | IllegalAccessException | InvocationTargetException e ){
^
symbol: class InvocationTargetException
location: class DatabaseDemo