In Java is it possible to use ternary to pass multiple arguments into a method call?
For example - in a method have:
print(degree == 270 ? "e", 5 : "t", 6);
which calls:
public void print(String s, int t){
}
By using the ternary I want to pass in e and 5 OR t and 6. Without the need of having to duplicate code - like:
print(degree == 270 ? "e" : "t", degree == 270? 5 : 6);
I don't think some understand, I don't want to use this method above, it runs the check an unnecessary time.
Why not
(degree == 270) ? print("e", 5) : print("t", 6);
EDIT: apparently does not work in java :/