Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Difference between InvalidParameterException and IllegalArgumentException

807589Nov 24 2008 — edited Nov 25 2008
Hi,
What is the difference between InvalidParameterException and IllegalArgumentException? As I understood from the Java documentation, IllegalArumentException is the one, that can be used for validating the arguments to a method. However the InvalidParameterException which extends from IllegalArugmentException is used in the java.security package as per the Java documentation, but this too for the parameter validation to a method. Then, what is the need for a special exception in the security package with the same meaning? Anyway, IllegalArgumentException is also used at some places in the secuity package. So when to use an IllegalArugmentException and when to use an InvalidParameterException is not clear. Somebody please put some light to this.

Regards,
Thomas.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 23 2008
Added on Nov 24 2008
3 comments
1,141 views