# Ruby and Java equality usage

**URL:** <https://www.ruby-forum.com/t/ruby-and-java-equality-usage/64487>\
**Category:** Ruby\
**Created:** [June 26, 2006, 1:41pm UTC](https://www.ruby-forum.com/t/ruby-and-java-equality-usage/64487 "2006-06-26T13:41:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandru\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@Alexandru\_P](https://www.ruby-forum.com/u/Alexandru_P)\
**Post date:** [June 26, 2006, 1:41pm UTC](https://www.ruby-forum.com/t/ruby-and-java-equality-usage/64487/1 "2006-06-26T13:41:10Z")

</div>

Hi!

I have posted a quick (reminder like) entry about how equality is  
handled by Ruby and Java:

> **[A parallel of equality in 2 worlds (Ruby and Java)](http://themindstorms.blogspot.com/2006/06/parallel-of-equality-in-2-worlds-ruby.html)**
>
> Here is a short presentation of equality methods in Ruby and Java : Ruby Java Object#equal? == Object#eql? Object.equals Object#== O...

However, I feel I have missed to explain correctly why eql? and ==  
are both needed (and I’ve been reading through Ruby books and searched  
the ruby mailing list). Maybe somebody can clarify it and give a  
better example. I will be happy to update the entry to reflect the  
“new” knowledge.

./alex
