If without else ternary operator February 2, 2023 by Tarik No, you cannot do that. Instead try this: if(bool1 && bool2) voidFunc1();