---
title: "When and why Hashcode override in costume classes?"  
description: "When and why Hashcode override in costume classes?"  
author: "Royce Roy"  
published: 2015-03-28  
updated: 2015-03-28  
canonical: https://www.mindstick.com/forum/23061/when-and-why-hashcode-override-in-costume-classes  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# When and why Hashcode override in costume classes?

Why we override Hashcode in our costume classes?

## Replies

### Reply by Anonymous User

generally for every object contains one unique hashcode generated by jvm. \
hashcode tells the programmer which class object it is. \
\
OBJECT class produces one unique code for object. i.e, hexa decimal integer. \
\
if u dont like this hexa decimal numerical value there is a chance to overridde hashcode value and whatever value give for that object then u should override hashCode() method in ur class and return it.

### Reply by Anonymous User

if u want to check object's content then you have to override equal() and hashcode(). basically hashcode() is check reference address only


---

Original Source: https://www.mindstick.com/forum/23061/when-and-why-hashcode-override-in-costume-classes

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
