当前位置:网站首页>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 .
边栏推荐
- unbuntu(debian)下TFTP服务器搭建及测试
- Windows安装Redis详细步骤
- Alibaba cloud notes for the first time
- Integrated use of interlij idea and sonarqube
- Common formulas of probability theory
- 【Kotlin学习】运算符重载及其他约定——重载算术运算符、比较运算符、集合与区间的约定
- LeetCode每日一题(2305. Fair Distribution of Cookies)
- [set theory] order relation (eight special elements in partial order relation | ① maximum element | ② minimum element | ③ maximum element | ④ minimum element | ⑤ upper bound | ⑥ lower bound | ⑦ minimu
- 【Kotlin学习】类、对象和接口——带非默认构造方法或属性的类、数据类和类委托、object关键字
- [untitled] use of cmake
猜你喜欢
2022-2-14 learning xiangniuke project - generate verification code
Construction of simple database learning environment
Hudi data management and storage overview
Using Hudi in idea
Run flash demo on ECS
[point cloud processing paper crazy reading classic version 11] - mining point cloud local structures by kernel correlation and graph pooling
[set theory] order relation (eight special elements in partial order relation | ① maximum element | ② minimum element | ③ maximum element | ④ minimum element | ⑤ upper bound | ⑥ lower bound | ⑦ minimu
【Kotlin疑惑】在Kotlin类中重载一个算术运算符,并把该运算符声明为扩展函数会发生什么?
PolyWorks script development learning notes (I) - script development environment
Crawler career from scratch (IV): climb the bullet curtain of station B through API
随机推荐
Idea uses the MVN command to package and report an error, which is not available
1922. Count Good Numbers
Trial of the combination of RDS and crawler
Usage of pandas to obtain MySQL data
LeetCode每日一题(745. Prefix and Suffix Search)
Alibaba cloud notes for the first time
Call the contents of Excel cells opened at the same time - button line feed
Win10安装ELK
WARNING: You are using pip version 21.3.1; however, version 22.0.3 is available. Prompt to upgrade pip
Computing level network notes
LeetCode每日一题(1024. Video Stitching)
Flink学习笔记(九)状态编程
Hudi integrated spark data analysis example (including code flow and test results)
Install third-party libraries such as Jieba under Anaconda pytorch
【点云处理之论文狂读前沿版11】—— Unsupervised Point Cloud Pre-training via Occlusion Completion
Install database -linux-5.7
[solution to the new version of Flink without bat startup file]
Django operates Excel files through openpyxl to import data into the database in batches.
2022-1-6 Niuke net brush sword finger offer
制作jetson nano最基本的根文件系统、服务器挂载NFS文件系统