BooleanSupplier getAsBoolean gets a result as boolean type from the functional interface.
getAsBoolean
has the following syntax.
boolean getAsBoolean()
The following example shows how to use getAsBoolean
.
import java.util.function.BooleanSupplier; public class Main { public static void main(String[] args) { BooleanSupplier bs = () -> true; System.out.println(bs.getAsBoolean()); } }
The code above generates the following result.