---
title: "Discussion on \"equals() VS ==\" | Hashnode"
description: "Discussion on \"equals() VS ==\". equals() is a method that compares the actual content of the object.\n\"==\" is an operator that compares the memory or reference location of an object in the heap.\nequals()\n\nThe String equals() function compares two strings based on their data/content...."
url: "https://hashnode.com/posts/equals-vs/645828ea36873323f6d75c93"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [equals() VS ==](https://codegallery.hashnode.dev/equals-vs?utm_source=hashnode&utm_medium=feed)

equals() is a method that compares the actual content of the object. "==" is an operator that compares the memory or reference location of an object in the heap. equals() The String equals() function compares two strings based on their data/content....

May 7, 2023 · 2 min read · codegallery.hashnode.dev  
Read the article

-   [#java](https://hashnode.com/tag/java)
-   [#equals](https://hashnode.com/tag/equals)
-   [#pt0](https://hashnode.com/tag/pt0)

## Written by

[Parvathi Somasundaram](https://hashnode.com/@sparvathi6023)

@sparvathi6023

  
[View profile](https://hashnode.com/@sparvathi6023)

## Responses 1

Markdown supported · ⌘↵ to post

[SKV](https://hashnode.com/@SKValli)

[May 8, 2023](https://hashnode.com/posts/equals-vs/645828ea36873323f6d75c93/comment/6458c192a7fbb23dbe43a6ab)

Nice explanation....!!!!!

[Parvathi Somasundaram](https://hashnode.com/@sparvathi6023)

[May 8, 2023](https://hashnode.com/posts/equals-vs/645828ea36873323f6d75c93/comment/6458c192a7fbb23dbe43a6ab#reply-64591f8ca7fbb23dbe43b5af)

Thank you ;)
