Issue
Make it any difference to use in the following snippet boolean filterMode or Boolean filterMode? Are they any best practice ? Or its completley irrelevant?
@GetMapping
public NOTMATTER getResultByBoolean(
@RequestParam(value = "filterMode", required = false) boolean filterMode) {
//.....
}
Solution
Yes it will matter. As you have specified the parameter to be optional, if it is not supplied then default values will be different
// Boolean - default value is null
// boolean - default value is false
Answered By - johnnyutts
Answer Checked By - Dawn Plyler (JavaFixing Volunteer)