2010/5/15 Tarun Yadav <sameeryadav.eck2003 / gmail.com>:
> Hi Sebastian,
>
> I understand the case where I call has method on new Object.
>
> But In the first case I tried these two ways:
> a. A.hash
> b. A.class.hash
>
> Over here Both must call hash method on the Class's object(according to
> my understanding).
> But the value returned in both cases are different.

The class of A is "Class" (which is itself an object different from
A). So it's perfectly normal that the hash method returns an other
value.

Try A.object_id and A.class.object_id:

>> Array.object_id
=> 2148226700
>> Array.class
=> Class
>> Array.class.object_id
=> 2148257020
>> Class.object_id
=> 2148257020

Array.class and Class are the same object.

Cheers,

-- 
JJ Fleck
PCSI1 Lyc˝Ă Kl˝├er