当前位置: 首页>后端>正文

Java函数式接口:Supplier

Java函数式接口:Supplier,第1张
Java函数式接口:Supplier,第2张
Java函数式接口:Supplier,第3张

package unit6;

import java.util.function.Supplier;

public class Stream9 {

public static void main(String[] args) {

// java.util.function.Supplier

// ???????public interface Supplier<T> {

// ???????????T get();

// ???????}

// 供给型接口:没有参数、只有返回值

Supplier supplier = ()->{return 100;};

Object o = supplier.get();

System.out.println(o);

}

}


https://www.xamrdz.com/backend/3ud1923389.html

相关文章: