I was wondering whether it is possible to assign a variable a value inside a conditional operator like so:
if((int v = someMethod()) != 0) return v;
Is there some way to do this in Java? Because I know it's possible in
conditions, but I'm not sure if I'm doing it wrong for the if-statement or if it's just not possible.