Java 8 | BooleanSupplier Interface with Examples Last Updated : 10 Oct, 2018 Comments Improve Suggest changes 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 Java 8 | DoubleSupplier Interface with Examples The DoubleSupplier 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 double value. The lambda expression assigned to an object of Doubl 1 min read 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 Java 8 | DoubleToIntFunction Interface in Java with Example The DoubleToIntFunction 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 takes in a double-valued argument and gives an int-valued result. The lambda expression assigned to an obj 1 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 Boolean booleanValue() method in Java with examples The booleanValue() method of Boolean Class is a built in method in java which is used to return the primitive boolean value of instance which is used to call the method booleanValue(). Syntax BooleanObject.booleanValue() Return Value: It returns a primitive boolean value. Below are the examples to i 1 min read Boolean compareTo() method in Java with examples The compareTo() method of Boolean class is a built in method in Java which is used to compare the given Boolean instance with the current instance. Syntax: BooleanObject.compareTo(Boolean a) Parameters: It takes a Boolean value a as parameter which is to be compared with the current instance. Return 2 min read Java Guava | Booleans.compare() method with Examples The compare() method of Booleans Class in the Guava library is used to compare the two specified boolean values. These values are passed as the parameter and the result of comparison is found as the difference of 1st value and the 2nd value. Hence it can be positive, zero or negative. Syntax: public 2 min read Like