当前位置:网站首页>Equality judgment of long type
Equality judgment of long type
2022-07-03 09:30:00 【padDio】
When I was working on the project today, I couldn't get the desired results , Finally, it was found that there was a problem with a judgment statement . There are two Long The initial assignment of variables of type is 10000, But with “==” To judge the result is to judge that they are not equal .
Long There is ⼀ A static inner class LongCache, special ⽤ It depends on the cache -128⾄127 Between the value of the ,⼀ common 256 Elements . If it's worth [-128, 127] Between , Will be put in the cache ⾥⾯, Use at this time “==” It can be judged that two variables are equal .⽽ Beyond this range, we have to new⼀ A new object , in other words "==" Cannot judge whether objects are equal .
It was later changed to equals() To judge , Finally, it runs successfully .
边栏推荐
- Simple use of MATLAB
- Modify idea code
- Construction of simple database learning environment
- 小王叔叔的博客目录【持续更新中】
- Logstash+jdbc data synchronization +head display problems
- Flink学习笔记(九)状态编程
- Crawler career from scratch (I): crawl the photos of my little sister ① (the website has been disabled)
- Hudi data management and storage overview
- Vscode编辑器右键没有Open In Default Browser选项
- Numerical analysis notes (I): equation root
猜你喜欢
On February 14, 2022, learn the imitation Niuke project - develop the registration function
CATIA automation object architecture - detailed explanation of application objects (I) document/settingcontrollers
[point cloud processing paper crazy reading classic version 11] - mining point cloud local structures by kernel correlation and graph pooling
Computing level network notes
数字身份验证服务商ADVANCE.AI顺利加入深跨协 推进跨境电商行业可持续性发展
小王叔叔的博客目录【持续更新中】
Install third-party libraries such as Jieba under Anaconda pytorch
Hudi learning notes (III) analysis of core concepts
Flink学习笔记(十一)Table API 和 SQL
2022-2-14 learning xiangniuke project - generate verification code
随机推荐
制作jetson nano最基本的根文件系统、服务器挂载NFS文件系统
Basic knowledge of database design
Flask+supervisor installation realizes background process resident
PIP configuring domestic sources
Banner - Summary of closed group meeting
Install database -linux-5.7
Spark 概述
[kotlin learning] operator overloading and other conventions -- overloading the conventions of arithmetic operators, comparison operators, sets and intervals
Just graduate student reading thesis
2022-2-14 learning xiangniuke project - Session Management
QT sub window is blocked, and the main window cannot be clicked after the sub window pops up
CATIA automation object architecture - detailed explanation of application objects (III) systemservice
图像修复方法研究综述----论文笔记
LeetCode每日一题(968. Binary Tree Cameras)
Matlab dichotomy to find the optimal solution
Liteide is easy to use
全球KYC服务商ADVANCE.AI 活体检测产品通过ISO国际安全认证 产品能力再上一新台阶
Failed building wheel for argon2 cffi when installing Jupiter
307. Range Sum Query - Mutable
Solve POM in idea Comment top line problem in XML file