# Object Equality

The rules that decide when two objects should count as having the same value.

## What is **Object Equality** in Java?

**Object Equality** — The rules that decide when two objects should count as having the same value.

```java
record Product(String name) {
}

class ProductCheck {
    boolean sameProduct(Product first, Product second) {
        return first.equals(second);
    }
}
```

Level: Journeyman · [More Java terms at this level](https://www.ask-codey.com/glossary/subjects/java/journeyman)

Updated: September 27, 2026

## In other subjects

- [Object Equality in C#](https://www.ask-codey.com/glossary/object-equality-c-sharp)

Source: https://www.ask-codey.com/glossary/object-equality
