throws
section.What did we do when we have need to throw some checked exception? We do:
public void doSomething() throws CannotDoSomethingException {
throw new CannotDoSomethingException();
}
where
public class CannotDoSomethingException extends Exception {
...
}
But we can to throw the checked exception without declaring it at throws section:
public void doSomething() {
Thread.currenThread().stop(new CannotDoSomethingException());
}
I think that this is veeeery bad code
No comments:
Post a Comment