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