Difference between equals() and "==" operator? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 2

Difference between equals() and "==" operator?

13th Oct 2017, 3:29 PM
Kaushal Baghel
4 Antworten
+ 9
assignment vs logic operator, dude😏
13th Oct 2017, 3:31 PM
\__(° = °)__/
+ 5
== -> compares values of primitive data-types, compares the memory location of Objects. equals() -> Compares values of Objects (Although, if you make your own equals() method it could really do anything).
13th Oct 2017, 4:06 PM
Rrestoring faith
Rrestoring faith - avatar
+ 5
@Gaurav Generally you wouldn't use == for decimals. 😛 (Due to inaccuracy of floating point numbers)
13th Oct 2017, 4:25 PM
Rrestoring faith
Rrestoring faith - avatar
+ 1
no problem Gaurav u have to learn more but sorry to say Ur answer is wrong
13th Oct 2017, 4:32 PM
Kaushal Baghel