I'd like to ask about best practices on return statements.
So, what would be more preferable, something like...
...
String r = null;
if(var != null) {
r = "NOT NULL!";
}
return r;
Or something like this...
...
if(var != null) {
return "NOT NULL!";
}
return null;
In other words, one return statement and the value returned is controlled through the function flow, or several escape points?