operators - JAVA Equals Alternative -
i wondering if there alternative following operator:
if (f == 0){ system.out.print(""); } else if (i %2 == 1){ system.out.print("; "); }
to clearer, alternative way of writing if statement's "==" , else if statement's %2 == 1
.
thanks.
system.out.print(f!=0 && i%2==1 ? "; " : "");
instead of modulo can flag out bits of except last 1 bitwise and.
the alternative i%2
i&1
.
Comments
Post a Comment