I have a question about the meaning (evaluation) of Boolean variables in return statements in Java.
I know that:
if (var) { ... }
i
Your method will work, but it can be a bit unclear what exactly should happen, especially if you just have variables named a and b. You want to document the method and have variables with proper names.
Also, if the code is confusing to you just after you wrote it, think of someone who will come in 6 months and won't have any idea what is going on. Proper documentation and comments will help greatly.