Java 8 | BooleanSupplier Interface with Examples Last Updated : 10 Oct, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report The BooleanSupplier Interface is a part of the java.util.function package which has been introduced since Java 8, to implement functional programming in Java. It represents a function which does not take in any argument but produces a boolean value. The lambda expression assigned to an object of BooleanSupplier type is used to define its getAsBoolean() which eventually applies the given operation on its argument. It is similar to using an object of type Supplier<Boolean> Functions in BooleanSupplier Interface The BooleanSupplier interface consists of the only one function: 1. getAsBoolean() This method does not take in any value but produces a boolean result. Syntax: boolean getAsBoolean() Return Value: This method returns a boolean value. Below is the code to illustrate getAsBoolean() method: Program: Java // Java program to illustrate // getAsBoolean() method of // BooleanSupplier Interface import java.util.function.BooleanSupplier; public class GFG { public static void main(String args[]) { // Create a BooleanSupplier instance BooleanSupplier sup = () -> true; // Get the boolean value // Using getAsBoolean() method System.out.println(sup.getAsBoolean()); } } Output: true Comment More infoAdvertise with us Next Article Java 8 | BooleanSupplier Interface with Examples P psil123 Follow Improve Article Tags : Misc Java Java - util package Java 8 Practice Tags : JavaMisc Similar Reads Map.Entry interface in Java with example Map.Entry interface in Java provides certain methods to access the entry in the Map. By gaining access to the entry of the Map we can easily manipulate them. Map.Entry is a generic and is defined in the java.util package. Declaration : Interface Map.Entry k -> Key V -> Value Methods: equals (O 4 min read Boolean equals() method in Java with examples The equals() method of Boolean class is a built in method of Java which is used check equality of two Boolean object. Syntax: BooleanObject.equals(Object ob) Parameter: It take a parameter ob of type Object as input which is the instance to be compared. Return Type: The return type is boolean. It re 2 min read Class isInterface() method in Java with Examples The isInterface() method of java.lang.Class class is used to check if this Class is an interface. The method returns true if this Class is an interface. It returns false otherwise. Syntax: public boolean isInterface() Parameter: This method does not accept any parameter. Return Value: This method re 2 min read Boolean compare() method in Java with Examples The compare() method of Boolean class is a built in method in Java which is used to compare two boolean values. It is a static method, so it can be called without creating any object of the Boolean class i.e. directly using the class name. Syntax: Boolean.compare(boolean a, boolean b) Parameters: It 2 min read Java 8 | IntSupplier Interface with Examples The IntSupplier Interface is a part of the java.util.function package which has been introduced since Java 8, to implement functional programming in Java. It represents a function which does not take any argument but produces an int value. The lambda expression assigned to an object of IntSupplier t 1 min read Like