SyntaxFix
Write A Post
Hire A Developer
Questions
Java has a large number of built-in exceptions for different scenarios.
In this case, you should throw an IllegalArgumentException, since the problem is that the caller passed a bad parameter.
IllegalArgumentException