当前位置:网站首页>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 .
边栏推荐
- Logstash+jdbc data synchronization +head display problems
- 基于opencv实现桌面图标识别
- Beego learning - Tencent cloud upload pictures
- Hudi 数据管理和存储概述
- 【Kotlin疑惑】在Kotlin类中重载一个算术运算符,并把该运算符声明为扩展函数会发生什么?
- Please tell me how to set vscode
- WARNING: You are using pip ; however. Later, upgrade PIP failed, modulenotfounderror: no module named 'pip‘
- Computing level network notes
- 【点云处理之论文狂读前沿版11】—— Unsupervised Point Cloud Pre-training via Occlusion Completion
- Solve POM in idea Comment top line problem in XML file
猜你喜欢

2022-2-13 learning the imitation Niuke project - home page of the development community
![[kotlin learning] classes, objects and interfaces - define class inheritance structure](/img/66/34396e51c59504ebbc6b6eb9831209.png)
[kotlin learning] classes, objects and interfaces - define class inheritance structure

Spark overview

Hudi data management and storage overview

Redis learning (I)

Django operates Excel files through openpyxl to import data into the database in batches.

解决Editor.md上传图片获取不到图片地址问题

Jenkins learning (I) -- Jenkins installation

Computing level network notes

Flask+supervisor installation realizes background process resident
随机推荐
Flink学习笔记(十一)Table API 和 SQL
[kotlin learning] classes, objects and interfaces - classes with non default construction methods or attributes, data classes and class delegates, object keywords
The idea of compiling VBA Encyclopedia
There is no open in default browser option in the right click of the vscade editor
Move anaconda, pycharm and jupyter notebook to mobile hard disk
The server denied password root remote connection access
2022-1-6 Niuke net brush sword finger offer
Bert install no package metadata was found for the 'sacraments' distribution
C language programming specification
Just graduate student reading thesis
制作jetson nano最基本的根文件系统、服务器挂载NFS文件系统
DSP data calculation error
PIP configuring domestic sources
LeetCode每日一题(2212. Maximum Points in an Archery Competition)
Crawler career from scratch (IV): climb the bullet curtain of station B through API
Flask+supervisor installation realizes background process resident
Overview of image restoration methods -- paper notes
解决Editor.md上传图片获取不到图片地址问题
npm install安装依赖包报错解决方法
Long类型的相等判断