当前位置:网站首页>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 .
边栏推荐
- IDEA 中使用 Hudi
- LeetCode每日一题(516. Longest Palindromic Subsequence)
- 【Kotlin学习】类、对象和接口——带非默认构造方法或属性的类、数据类和类委托、object关键字
- 【Kotlin学习】高阶函数的控制流——lambda的返回语句和匿名函数
- Just graduate student reading thesis
- Common formulas of probability theory
- Uc/os self-study from 0
- 2022-2-14 learning xiangniuke project - generate verification code
- Crawler career from scratch (II): crawl the photos of my little sister ② (the website has been disabled)
- 一款开源的Markdown转富文本编辑器的实现原理剖析
猜你喜欢

Windows安装Redis详细步骤

Solve the problem of disordered code in vscode development, output Chinese and open source code

CATIA automation object architecture - detailed explanation of application objects (I) document/settingcontrollers

LeetCode每日一题(1162. As Far from Land as Possible)

Crawler career from scratch (II): crawl the photos of my little sister ② (the website has been disabled)
![[point cloud processing paper crazy reading classic version 11] - mining point cloud local structures by kernel correlation and graph pooling](/img/40/e0c7bad60b19cafa467c229419ac21.png)
[point cloud processing paper crazy reading classic version 11] - mining point cloud local structures by kernel correlation and graph pooling

Win10安装ELK

Alibaba cloud notes for the first time

Using Hudi in idea

2022-2-14 learning the imitation Niuke project - send email
随机推荐
Detailed steps of windows installation redis
LeetCode每日一题(2212. Maximum Points in an Archery Competition)
Basic knowledge of database design
【毕业季|进击的技术er】又到一年毕业季,一毕业就转行,从动物科学到程序员,10年程序员有话说
Usage of pandas to obtain MySQL data
IDEA 中使用 Hudi
LeetCode每日一题(2090. K Radius Subarray Averages)
2022-2-13 learn the imitation Niuke project - Project debugging skills
Common software open source protocols
Vscode Arduino installation Library
专利查询网站
LeetCode每日一题(931. Minimum Falling Path Sum)
软件测试工程师是做什么的 通过技术测试软件程序中是否有漏洞
PIP configuring domestic sources
LeetCode每日一题(1024. Video Stitching)
用Redis实现分布式锁
Django operates Excel files through openpyxl to import data into the database in batches.
【点云处理之论文狂读前沿版11】—— Unsupervised Point Cloud Pre-training via Occlusion Completion
About the configuration of vs2008+rade CATIA v5r22
WARNING: You are using pip version 21.3.1; however, version 22.0.3 is available. Prompt to upgrade pip