From db82c000bed568b01fde310fc4cbc15d849d93ab Mon Sep 17 00:00:00 2001 From: cpucode <923992029@qq.com> Date: Tue, 15 Sep 2020 18:36:07 +0800 Subject: [PATCH] =?UTF-8?q?lambda3=5F=5F=E4=BD=BF=E7=94=A8=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lambda/lambda3.java | 30 ++++++++++++++++++++++++++++++ README.md | 4 ++-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 Lambda/lambda3.java diff --git a/Lambda/lambda3.java b/Lambda/lambda3.java new file mode 100644 index 00000000..cfb3f90a --- /dev/null +++ b/Lambda/lambda3.java @@ -0,0 +1,30 @@ +/* + * @由于个人水平有限, 难免有些错误, 还请指点: + * @Author: cpu_code + * @Date: 2020-09-15 18:34:01 + * @LastEditTime: 2020-09-15 18:36:00 + * @FilePath: \java\Lambda\lambda3.java + * @Gitee: [https://gitee.com/cpu_code](https://gitee.com/cpu_code) + * @Github: [https://github.com/CPU-Code](https://github.com/CPU-Code) + * @CSDN: [https://blog.csdn.net/qq_44226094](https://blog.csdn.net/qq_44226094) + * @Gitbook: [https://923992029.gitbook.io/cpucode/](https://923992029.gitbook.io/cpucode/) + */ +package Lambda; + +public class lambda3 { + public static void main(String[] args){ + Runnable task = new RunnableImpl(); + new Thread(task).start(); + } +} + +class RunnableImpl implements Runnable{ + @Override + public void run() { + System.out.println("多线程任务执行"); + } +} + +/* +多线程任务执行 +*/ \ No newline at end of file diff --git a/README.md b/README.md index fc5c7b48..4a7cb36d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ * @由于个人水平有限, 难免有些错误, 还请指点: * @Author: cpu_code * @Date: 2020-07-12 12:03:11 - * @LastEditTime: 2020-09-15 18:11:48 + * @LastEditTime: 2020-09-15 18:33:57 * @FilePath: \java\README.md * @Gitee: [https://gitee.com/cpu_code](https://gitee.com/cpu_code) * @Github: [https://github.com/CPU-Code](https://github.com/CPU-Code) @@ -301,7 +301,7 @@ java编程基础 面向对象 javaAPI 集合 IO GUI JD8C 多线程 网络编程 - [x] [lambda1__冗余的Runnable代码](thread/lambda1.java) - [x] [lambda2__Lambda优写](thread/lambda2.java) - +- [x] [lambda3__使用实现类](thread/lambda3.java) -----------