Is there an advantage to declaring that a method throws an unchecked exception?
If I have a method which throws an unchecked exception, e.g.: void doSomething(int i) { if (i < 0) throw new IllegalArgumentException("Too small"); // ... } is there any advantage to explicitly declaring that the method throws the exception, i.e. void doSomething(int i) throws IllegalArgumentException { if (i < 0) throw new IllegalArgumentException("Too small"); // ... } as opposed to (or in addition to) describing the behaviour in javadoc: /** * This method does something useful. * @param i some input value * @throws IllegalArgumentException if {@code i < 0} */ void doSomething(int i) { if (i