当前位置:网站首页>Similarities and differences between equals and "= ="
Similarities and differences between equals and "= ="
2022-07-25 22:48:00 【Cool hair】
The same thing :
1. Are used to compare whether the contents of objects are equal ;
2. All have return values , The return value types are boolean.
Difference :
1.equals Used to compare the contents of reference types , Cannot be used to compare basic data types ;
2.“==” Usually used to compare basic data types , Compare the memory addresses of the two objects , Generally, it is not used for comparing reference type data .
summary :
1. If it's some plastic surgery , Such as byte,short etc. , Use “==” To compare
2. If it's an object , Use equals Methods for comparison
3. If it is double,float This type , Then transpose first int Or is it long This type can be used again “==” Compare
4. If it is the contents of the array , Use equals Methods to compare .
边栏推荐
- [natural language processing] [vector representation] augsbert: improve the data enhancement method of Bi encoders for paired sentence scoring tasks
- 2020-09-17
- Why is Google's internal tools not suitable for you?
- Hcie is finally in hand, and the road begins
- 自媒体人必备的4个素材网站,再也不用担心找不到素材
- Structure principle of micro ball vibration switch with chip
- We media people must have four resource tools, each of which is very practical
- Session and cookie, token and storage
- Share two music playing addresses
- LabVIEW develops PCI-1680U dual port can card
猜你喜欢

Multi data source switching

Share two music playing addresses

IFLYTEK smart office book air e-book reader makes my work life healthier

Interview question 17.11. word distance ●●

Binder原理

LabVIEW 开发 PCI-1680U双端口CAN卡

【集训DAY13】Backpack【动态规划】【贪心】

MatrixCube揭秘102——300行实现的完整分布式存储系统MatrixKV

(1) DDL, DML, DQL, DCL and common data types

单元测试,写起来到底有多痛?
随机推荐
Why should we launch getaverse?
【集训DAY15】简单计算【树状数组】【数学】
【集训DAY15】Boring【树形DP】
Kibana~后台启动Kibana之后无法找到进程号
MySQL data type
【PMP学习笔记】第1章 PMP体系引论
汇编语言与微机原理实验一、实验二、实验三:分支程序设计/循环程序设计/子程序设计
Qt5.12 installation error prompt: c:\qt5.12.11\vcredist\vcredist_ msvc2019_ x86.exe /norestart /q
Five constraints and three paradigms
1000个Okaleido Tiger首发上线Binance NFT,引发抢购热潮
QT log file system
Scratch seamless butt bron filter
[natural language processing] [vector representation] augsbert: improve the data enhancement method of Bi encoders for paired sentence scoring tasks
Common software shortcuts
Experiment 1, experiment 2 and Experiment 3 of assembly language and microcomputer principle: branch program design / loop program design / subroutine design
【集训DAY15】好名字【hash】
Examples and points for attention about the use of getchar and scanf
JVM内存区域
HCIE终到手,路才开始
[training Day12] x equation [high precision] [mathematics]