---
title: "Comment by Sayantani Dey on \"Why should we prefer using .equals() to == while comparing strings in Java?\" | Hashnode"
description: "The explanation was so clear, looking forward to your blogs❤️"
url: "https://hashnode.com/posts/why-should-we-prefer-using-equals-to-while-comparing-strings-in-java/61f022a587fd2728e7cd38e9/comment/6207d2d2a2be760e35396220"
---

[Discussion](https://hashnode.com/posts/why-should-we-prefer-using-equals-to-while-comparing-strings-in-java/61f022a587fd2728e7cd38e9)

Comment [Why should we prefer using .equals() to == while comparing strings in Java?](https://hashnode.com/posts/why-should-we-prefer-using-equals-to-while-comparing-strings-in-java/61f022a587fd2728e7cd38e9)

[Sayantani Dey](https://hashnode.com/@sayantani-dey)

[Feb 12, 2022](https://hashnode.com/posts/why-should-we-prefer-using-equals-to-while-comparing-strings-in-java/61f022a587fd2728e7cd38e9/comment/6207d2d2a2be760e35396220)

The explanation was so clear, looking forward to your blogs❤️

[Samadrita Shaw](https://hashnode.com/@shawsamadrita)

[Feb 12, 2022](https://hashnode.com/posts/why-should-we-prefer-using-equals-to-while-comparing-strings-in-java/61f022a587fd2728e7cd38e9/comment/6207d2d2a2be760e35396220#reply-6207df52a2be760e3539636c)

Thanks a bunch, Sayantani!
