lundi 4 novembre 2019

When should we choose to throw an exception?

When should we chose to throws an exception?

 public Something sqlQuery(String sqlQuer) throws SqlException {

 }

We can catch this exception in try catch.

In which situation does we choose to use throws instead of catching immediately? is it some design pattern related?

Aucun commentaire:

Enregistrer un commentaire