An Interface that contains exactly one abstract method is known as a functional interface.
It can have any number of default, static methods but can contain only one abstract method. It can also declare the methods of the object class.
Functional Interface is also known as Single Abstract Method Interfaces or SAM Interfaces. It is a new feature in Java 8, which helps to achieve a functional programming approach.
A functional interface can extend another interface only when it does not have any abstract method.
The Java API has many one-method interfaces such as Runnable, Callable, Comparator, ActionListener, and others. They can be implemented and instantiated using anonymous class syntax.
Sur cette page du site, vous pouvez voir la vidéo en ligne Java Functional Interfaces with Lambda - The Developer Guide durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Ramesh Fadatare - AI & Tech 15 octobre 2024, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 688 fois et il a aimé 22 téléspectateurs. Bon visionnage!