/**
* Gets a result.
*
* @return a result
*/Tget();
函数型
Function<T, R>
UnaryOperator<T>
BiFunction<T, U, R>
BinaryOperator<T>
ToIntFunction<T>
ToLongFunction<T>
ToDoubleFunction
IntFunction<R>
LongFunction<R>
DoubleFunction<R>
断言型
Predicate<T>
1
2
3
4
5
6
7
8
/**
* Evaluates this predicate on the given argument.
*
* @param t the input argument
* @return {@code true} if the input argument matches the predicate,
* otherwise {@code false}
*/booleantest(Tt);
publicclassTest12{publicstaticvoidmain(String[]args){Test12test12=newTest12();MyFunctionalInterface02myFunctionalInterface=()->test12.objectGet();System.out.println(myFunctionalInterface.get());// lambda表达式写法MyFunctionalInterface02myFunctionalInterface02=test12::objectGet;System.out.println(myFunctionalInterface.get());}publicStringobjectGet(){return"object get method.";}}