Sorry,
I was wrong when I said that NullPointerException was thrown programmatically.
The question is whether the programmer controls the creation of the exception/error, not whether they caused it due to a mistake.
So, if I throw my onwn created exception programmatically inside an initialization block getting an ExceptionInInitializerError,
caused by MyException, could I consider it as thrown programmatically?
Example:
Output:
java.lang.ExceptionInInitializerError
Caused by: exceptions.MyException
at exceptions.ErroInicializacao.getValueException(ErroInicializacao.java:10)
at exceptions.ErroInicializacao.<clinit>(ErroInicializacao.java:7)
Exception in thread "main"
Thanks