2024年2月20日发(作者:)

通过collection获取对象,通过map 获取流:

package Test01;import .*;import ;/** * @auther SyntacticSugar * @data 2018/9/3 0003下午 1:20 *

*

* static Stream values) 返回其元素是指定值的顺序排序流。 *

* ①根据collection 来获取流 * ②根据map来获取流 */public class Test10 { public static void main(String[] args) {//collection list set Collection string1 = new ArrayList<>(); Stream s1 = (); sop(s1); List string2 = new ArrayList<>(); Stream s2 = (); sop(s2); Set string3 = new HashSet<>(); Stream s3 = (); sop(s3);// ncePipeline$Head@4b6995df// ncePipeline$Head@2fc14f68// ncePipeline$Head@61443d8f } public static void sop(Object obj) { n(obj); }}