X Tutup
Skip to content

Latest commit

 

History

History
45 lines (27 loc) · 821 Bytes

File metadata and controls

45 lines (27 loc) · 821 Bytes
aliases
tags
java
functional
stream
optional
created 2025-02-16 12:08:35 -0800
modified 2025-02-25 03:03:06 -0800

Java 函数式编程


Functional Interface

#函数接口

Functional Interface:函数接口,这是 JDK8 提供新的接口。

「函数接口」是有且只有一个抽象方法的接口。

函数接口可以用 @FunctionalInterface 注解来标识函数接口。

但无论是否用 @FunctionalInterface 标识接口,只要此接口有且只有一个抽象方法,那此接口便是「函数接口」。


Lambda

方法引用

方法引用:Method Reference 这是 Lambda 表达式的简化写法,用于直接引用已有的方法。

Stream API

Optional


相关笔记

X Tutup