If without else ternary operator

No, you cannot do that. Instead try this:

if(bool1 && bool2) voidFunc1();

As mentioned in the other answers, you can't use a ternary operator to do this.

However, if the need strikes you, you can use Java 8 Optional and lambdas to put this kind of logic into a single statement:

Optional.of(pstmt).ifPresent((p) -> p.close())

Why using ternary operator when you have only one choice?

if (pstmt != null) pstmt.close(); 

is enough!