博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Lambda表达式概念理解
阅读量:3945 次
发布时间:2019-05-24

本文共 563 字,大约阅读时间需要 1 分钟。

package ceshi;/** * @author: Boss * Date: 2021/1/27 * Time: 8:54 * Description: */public interface Sout {
String returnString();}
package ceshi;/** * @author: Boss * Date: 2021/1/26 * Time: 17:27 * Description: */public class test {
private static void pri(Sout Sout) {
//调用Sout实现类中的唯一方法 System.out.println(Sout.returnString()); } public static void main(String[] args) {
//1.Sout的实现,复写里面的唯一方法.方法体为"null" Sout sout = () -> "返回值"; pri(sout); //2.简写成直接调用实现就可以了 pri(() -> "返回值"); }}

转载地址:http://fuowi.baihongyu.com/

你可能感兴趣的文章
Storing and Searching for Data 数据存储和搜索
查看>>
Remaining Backward Compatible 保持向后兼容
查看>>
Remembering Your User 记住你的用户
查看>>
Authenticating to OAuth2 Services 验证OAuth2服务
查看>>
Creating a Custom Account Type 创建自定义帐户类型
查看>>
Sending Content to Other Apps 将内容发送到其他应用程序
查看>>
Receiving Content from Other Apps 接收来自其他应用程序的内容
查看>>
Adding an Easy Share Action 添加一个简单的共享行动
查看>>
Taking Photos Simply 简单地拍摄照片
查看>>
Recording Videos Simply 简单录制视频
查看>>
Controlling the Camera 控制相机
查看>>
Creating Multiple APKs for Different API Levels 创建多个不同的API级别的APK
查看>>
Creating Multiple APKs for Different Screen Sizes 创建多个APKs为不同的屏幕尺寸
查看>>
Creating Multiple APKs for Different GL Textures 创建多个APK给不同的GL结构
查看>>
Android Package and Manifest File
查看>>
Creating Multiple APKs with 2+ Dimensions 创建两种以上屏幕尺寸多apk支持
查看>>
Abstracting the New APIs 抽象出新的API
查看>>
Proxying to the New APIs 代理新的API
查看>>
Creating an Implementation with Older APIs 用较早版本的APIs实现抽象类
查看>>
Using the Version-Aware Component 使用版本识别组件
查看>>