Published
- 1 min read
method to check parameters in java
The solution for this is noted below
method to check parameters in java
Solution
//Method can also be void
//String parameter can be removed
public boolean checkParam(boolean condition, String msg){
if(!condition) throw new IllegalArgumentException(msg);
return true;
}
Try other methods by searching on the site. That is if this doesn’t work