J2SE 8的Lambda --- functions
摘要:functions //1. Runnable 输入参数:无 返回类型void new Thread(() -> System.out.println("In Java8!") ).start(); System.out.println(); ...
阅读全文
posted @
2018-01-30 23:21
刘达人186
阅读(126)
推荐(0)
J2SE 8的Lambda --- 语法
摘要:语法例子 LambdaGrammarTest lambdaTest = new LambdaGrammarTest(); // 1. 能够推导出类型的,可以不写类型 String[] planets = new String[] { "11", "22", "3...
阅读全文
posted @
2018-01-30 23:12
刘达人186
阅读(142)
推荐(0)
J2SE 8的流库 --- 收集处理结果
摘要:分类:简单计算, 收集到映射表中 , 群组和分组, 下游收集器, 约简操作 reduce()ArrayList arrayList = new ArrayList();arrayList.add("aa");arrayList.add("aA");arrayList....
阅读全文
posted @
2018-01-30 00:11
刘达人186
阅读(137)
推荐(0)
J2SE 8的流库 --- 转换流, 得到的还是流
摘要:流的转换, 按照条件过滤/映射/摊平/截取/丢弃/连接/去重/排序。辅助方法public static int myCompare(String x, String y) { if(x.length()>y.length()){ return 1; }else if...
阅读全文
posted @
2018-01-29 21:00
刘达人186
阅读(133)
推荐(0)
J2SE 8的流库 --- 基本类型流的使用
摘要:展现流的方法public static void show(String title, Stream stream){ System.out.println("title:"+title); List collect = stream.limit(10).coll...
阅读全文
posted @
2018-01-29 20:44
刘达人186
阅读(264)
推荐(0)
J2SE 8的流库 --- 生成流
摘要:本文介绍了如何产生J2SE 8的流, 包括基本类型的流IntStream, LongStream, DoubleStream 。展现流的方法public static void show(String title, Stream stream){ System.ou...
阅读全文
posted @
2018-01-29 20:32
刘达人186
阅读(116)
推荐(0)