I am trying to figure out how to use operators ? : instead if else block
My case is below:
if (boolean variable) {
void1(); }
else {
void2();
}
is it possible to do this by that way:
boolean variable ? void1() : void2();
I was looking for an answer but I cannot find it with boolean and call void method