当前位置:网站首页>The difference between equals and = =

The difference between equals and = =

2022-06-11 08:18:00 Want Xiaoxin

1、== Whether two variables or instances point to the same memory space ,equals It is used to judge whether the value of the memory space pointed to by two variables or instances is the same
2、== It refers to the memory address to be compared ,equals() Is a comparison of the contents of a string
3、 == Refers to whether the references are the same ,equals Refers to whether the values are the same
 Insert picture description here
1、== Is a comparison operator ,equals() yes object Methods in class
2、 The speed of computing is faster than equals() fast , because It's just a comparison

原网站

版权声明
本文为[Want Xiaoxin]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203020513375807.html