使用强转:List testLists=(List)(List)testList;
不生效,依旧是原本的类型
方法1:foreach把list的每一个元素强转转成Long
方法2:lambdamap中使用Long.parseLong去进行转换:List testLists = testList.stream().map(o->Long.parseLong( o.toString())).collect(Collectors.toList());
使用强转:List testLists=(List)(List)testList;
不生效,依旧是原本的类型
方法1:foreach把list的每一个元素强转转成Long
方法2:lambdamap中使用Long.parseLong去进行转换:List testLists = testList.stream().map(o->Long.parseLong( o.toString())).collect(Collectors.toList());