I was just wondering if this was possible because i started using ternary operators to reduce lines of code and i am loving it.
if (x==y) { z += x; } els
Four lines of code, and the most readable, IMO. No need for a ternary operator here:
if (x == y || x == z) z += y; else z++;
If I had to write it using ternary, I would do:
z += (x == y || x == z) ? y : 1;