当前位置:网站首页>Records of long objects and long judgments in the stream of list
Records of long objects and long judgments in the stream of list
2022-07-03 17:38:00 【Yuyang】
stay stream.filter Chinese comparison Long!=long The results of the process are not really filtered out , The specific phenomena are as follows :
long[] a = new long[]{7864, 284, 347, 7732, 8498};
Long bid = 123123l;
List<Long> il = new ArrayList<>();
il.add(1l);
il.add(2l);
il.add(3l);
il.add(123123l);
System.out.println(il.size());
List<Long> r=il.stream().filter(t -> t != bid).collect(Collectors.toList());
System.out.println(r.size());
result
From the result, we can see the code il.stream().filter(t -> t != bid).collect(Collectors.toList()); Medium filtration bid The value of is not in effect
Problem analysis :bid Defined as objects , Object and concrete value cannot be compared normally
terms of settlement : take bid Change it to big.longValue()
doubt ,Long Object direct comparison is OK , stay stream Not in the middle :
Long as = 1234l;
long b = 1234l;
long c = 11234l;
System.out.println(as != b);
System.out.println(as != c);
result
边栏推荐
- 自动渗透测试工具核心功能简述
- [combinatorics] recursive equation (example of solving recursive equation without multiple roots | complete process of solving recursive equation without multiple roots)
- 企业级自定义表单引擎解决方案(十一)--表单规则引擎1
- 毕业总结
- Unity notes unityxr simple to use
- vs2013已阻止安装程序,需安装IE10
- Installation and configuration of network hard disk NFS
- How to enforce parameters in PowerShell- How do I make parameters mandatory in PowerShell?
- Examination questions for the assignment of selected readings of British and American Literature in the course examination of Fujian Normal University in February 2022
- Getting started with deops
猜你喜欢
How to train mask r-cnn model with your own data
Cross border e-commerce: advantages of foreign trade enterprises in overseas social media marketing
Deops入门
Is AI too slow to design pictures and draw illustrations? 3 sets of practical brushes to save you
Simple use of unity pen XR grab
Luogu: p1155 [noip2008 improvement group] double stack sorting (bipartite graph, simulation)
PS screen printing brush 131, many illustrators have followed suit
Notes on problems -- watching videos on edge will make the screen green
1147_ Makefile learning_ Target files and dependent files in makefile
[error reporting] omp: error 15: initializing libiomp5md dll, but found libiomp5md. dll already initialized.
随机推荐
QT学习日记9——对话框
[combinatorics] recursive equation (case where the non-homogeneous part is exponential | example where the non-homogeneous part is exponential)
Write a program to process a list container of string type. Find a special value in the container 9.27: and delete it if found. Rewrite the above procedure with deque container.
PHP returns 500 errors but no error log - PHP return 500 error but no error log
VM11289 WAService. js:2 Do not have __ e handler in component:
TCP congestion control details | 3 design space
Luogu: p1155 [noip2008 improvement group] double stack sorting (bipartite graph, simulation)
Analyse ArrayList 3: suppression d'éléments
Tensorboard quick start (pytoch uses tensorboard)
Web-ui automated testing - the most complete element positioning method
Golang单元测试、Mock测试以及基准测试
[combinatorics] recursive equation (four cases where the non-homogeneous part of a linear non-homogeneous recursive equation with constant coefficients is the general solution of the combination of po
Kubernetes resource object introduction and common commands (III)
聊聊支付流程的设计与实现逻辑
Where is the database account used when running SQL tasks in data warehouse tasks configured
[combinatorics] recursive equation (special solution example 1 Hannover tower complete solution process | special solution example 2 special solution processing when the characteristic root is 1)
【JokerのZYNQ7020】DDS_ Compiler。
Online assignment 3 of mobile Internet technology in the 20th autumn of electronic technology [standard answer]
[combinatorics] recursive equation (summary of the solution process of recursive equation | homogeneous | double root | non-homogeneous | characteristic root is 1 | exponential form | the bottom is th
How SVN views modified file records