Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

'==' operator #2

Open
Abhimanyu10 opened this issue Jun 6, 2018 · 1 comment
Open

'==' operator #2

Abhimanyu10 opened this issue Jun 6, 2018 · 1 comment

Comments

@Abhimanyu10
Copy link

https://github.com/SedaKunda/HackerRank/blob/d346b889f5c4e3a5835e304d05a1f257bab4daab/Java/Data-Structure/JavaSort.java#L34

== operator compares the reference of an object in Java. As far as I know .equals() method checks the actual contents of the string .

@Raghav-Verma21
Copy link

We use == operators for reference comparison (address comparison) and .equals() method for content comparison.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants