This may be a dumb question, but I wonder if it is possible to have an if statement that fulfills all the conditions. I explain:
if (methodA() && methodB() && methodC()) {code}
code is executed when all three methods return true. The fact is that when a method returns false, the rest of the methods are not executed. This is usually good for performance, but what if I really need to execute all the methods no matter what they return, and after that evaluate the expression and switch to if or not. The same applies for OR or any other
Is there any way to say that java behaves like this? My current job is to divide it into three parts, but it doesnβt always do the trick and it looks really ugly.
source share