当前位置:网站首页>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 .
边栏推荐
- Serializer rewrite: update and create methods
- 2022-2-14 learning the imitation Niuke project - send email
- Liteide is easy to use
- 2022-2-13 learn the imitation Niuke project - Project debugging skills
- Win10安装ELK
- 【点云处理之论文狂读前沿版11】—— Unsupervised Point Cloud Pre-training via Occlusion Completion
- Basic knowledge of database design
- PolyWorks script development learning notes (III) -treeview advanced operation
- [kotlin learning] operator overloading and other conventions -- overloading the conventions of arithmetic operators, comparison operators, sets and intervals
- Hudi学习笔记(三) 核心概念剖析
猜你喜欢

Principles of computer composition - cache, connection mapping, learning experience

Beego learning - Tencent cloud upload pictures

MySQL installation and configuration (command line version)

Flink学习笔记(十一)Table API 和 SQL

全球KYC服务商ADVANCE.AI 活体检测产品通过ISO国际安全认证 产品能力再上一新台阶

Flask+supervisor installation realizes background process resident

About the configuration of vs2008+rade CATIA v5r22

Move anaconda, pycharm and jupyter notebook to mobile hard disk

Hudi quick experience (including detailed operation steps and screenshots)

Modify idea code
随机推荐
Quickly use markdown to edit articles
小王叔叔的博客目录【持续更新中】
Navicat, MySQL export Er graph, er graph
Database execution error: SQL_ mode only_ full_ group_ by:
LeetCode每日一题(2090. K Radius Subarray Averages)
基于opencv实现桌面图标识别
[kotlin learning] classes, objects and interfaces - classes with non default construction methods or attributes, data classes and class delegates, object keywords
2022-2-14 learning the imitation Niuke project - send email
Run flash demo on ECS
Jetson Nano 自定义启动图标kernel Logo cboot logo
NPM install installation dependency package error reporting solution
ERROR: certificate common name “www.mysql.com” doesn’t match requested host name “137.254.60.11”.
PolyWorks script development learning notes (II) -treeview basic operations
解决Editor.md上传图片获取不到图片地址问题
LeetCode每日一题(2109. Adding Spaces to a String)
DSP data calculation error
Win10 quick screenshot
Idea uses the MVN command to package and report an error, which is not available
2022-2-13 learn the imitation Niuke project - Project debugging skills
Notes on numerical analysis (II): numerical solution of linear equations