/**
* @program: javademo
* @description: 生成斐波那契数列
* @author: sunyuhua
* @create: 2021-11-22 15:24
**/
public class FbnqTest {
public static void main(String[] args) {
Stream.iterate(new int[]{0,1},t->new int[]{t[1],t[0]+t[1]})
.limit(20)
.map(t->t[0])
.forEach(System.out::println);
}
}
09-02
858
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)