当前位置:网站首页>获取两个集合相差数据
获取两个集合相差数据
2022-07-28 00:59:00 【ekkcole】
可以用来去除数据库和对比的集合不一致的数据
public class TestList {
public static void main(String[] args) {
// 浏览器
List<String> list = Arrays.asList( "2", "3", "4", "5");
// 数据库
List<String> list1 = Arrays.asList("1", "2", "4", "5", "7");
List<String> list2 =new ArrayList<>();
List<String> list3 =new ArrayList<>();
// list1中没有的
list2=list.stream().filter(e -> {
return !list1.contains(e);
}).collect(Collectors.toList());
// list中没有的
list3=list1.stream().filter(e -> {
return !list.contains(e);
}).collect(Collectors.toList());
System.out.println(list2);
System.out.println(list3);
}
}
边栏推荐
- Execute add migration migration and report build failed
- Promise从入门到精通(第3章 自定义(手写)Promise)
- Codeworks round 807 (Div. 2) a-c problem solution
- 11-Django-基础篇-数据库操作
- MySQL的pymysql操作
- 每条你收藏的资讯背后,都离不开TA
- Promise from getting started to mastering (Chapter 3: customize (handwriting) promise)
- 微信小程序图片根据屏幕比例缩放
- [website construction] update SSL certificate with acme.sh: change zerossl to letsencrypt
- 小程序毕设作品之微信校园维修报修小程序毕业设计成品(4)开题报告
猜你喜欢
![[database data recovery] data recovery case of insufficient disk space of SQL Server database](/img/0e/908db40e1e8b7dd62e12558c1c6dc4.png)
[database data recovery] data recovery case of insufficient disk space of SQL Server database

go 学习01

The level "trap" of test / development programmers is not a measure of one-dimensional ability

小程序毕设作品之微信校园维修报修小程序毕业设计成品(4)开题报告

Common problem types and methods of mathematical univariate differential proof problems in postgraduate entrance examination

产品解读丨MeterSphere UI测试模块的设计与分布式扩展

Flume(5个demo轻松入门)
![53: Chapter 5: develop admin management service: 6: develop [admin administrator exit login, interface]; (one point: when we want to modify a value with a certain coding method, the new value should b](/img/9a/674308c7a21fa2be0943ca7967e274.png)
53: Chapter 5: develop admin management service: 6: develop [admin administrator exit login, interface]; (one point: when we want to modify a value with a certain coding method, the new value should b

学会这招再也不怕手误让代码崩掉

重要安排-DX12引擎开发课程后续直播将在B站进行
随机推荐
feign调用get和post记录
Software testing interview question: why should we carry out testing in a team?
小程序毕设作品之微信校园维修报修小程序毕业设计成品(4)开题报告
Data output - dynamic drawing
如何评估研发人员效能?软件工程师报告帮你看见每个人的贡献
【数据库数据恢复】SQL Server数据库磁盘空间不足的数据恢复案例
APP如何上架App Store?
54:第五章:开发admin管理服务:7:人脸入库流程;人脸登录流程;浏览器开启视频调试模式(以便能够在本机的不安全域名的情况下,也能去开启摄像头);
Implementation of mongodb/mongotemplate.upsert batch inserting update data
LeetCode 热题 HOT 100 -> 1.两数之和
产品解读丨MeterSphere UI测试模块的设计与分布式扩展
剑指offer专项突击版第12天
How to evaluate the effectiveness of R & D personnel? Software Engineer reports help you see everyone's contribution
Software test interview question: please introduce the meaning of various test types in detail?
【愚公系列】2022年07月 Tabby集成终端的使用
focal loss原理及实现
Lightweight project management system
The cooperation between starfish OS and metabell is just the beginning
Principle and implementation of cross entropy
Two ways for wechat applet to realize dynamic horizontal step bar