<<< throw syntax | Index | Throw/rethrow exception example >>> |
A method that throws an unchecked exception
public double calculateValue(double value) { if ( value <= 0 ) { throw new IllegalArgumentException( "value must be > 0" ); } //... }
<<< throw syntax | Index | Throw/rethrow exception example >>> |