L'interface Consumer kaykon f java.util.function.
Syntax dialha:
@FunctionalInterface
public interface Consumer<T> {
void accept(T t);
}
- T type de l'argument
- t l'argument
- void type de retourne implique que la fonction makatrejee walo
Exemple dial program:
Consumer<Integer> consumer= new Consumer<Integer>() {
@Override
public void accept(Integer integer) {
System.out.println(integer);
}
};
nefs lcode walakin had lmera b lambda
Consumer<Integer> consumer1=(integer)-> System.out.println(integer);
Top comments (0)