Click here to Skip to main content
15,889,867 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi friends,
i want to know how object(root class) class created in .net or java.In that How methods are processed.For example object class has Equal method(Equals(object)),this method determine whether the specified Object is equal to the current Object.I dont know how it compare these two objects.Is there any dll file for comparision? please clear this doubt.
thank you
Posted

By default, the Equals method works in one of two ways:

For Value types it does a bit wise comparison: checking if the two object contents are the same.
For Reference types, it compares the references: if they are the same the objects are the same and there is no need to look at the content.

This behaviour can be overridden in derived classes (and is, for example, the String class is a Reference type which overrides the Equals method to do a byte-by-byte comparison of the two strings).
 
Share this answer
 
Comments
baskaran chellasamy 21-May-12 9:55am    
i just go with object class by using go definition from my class to know how base class is formed. In that it just has been written as a one line word(public virtual bool Equal(Object obj)).But i dont know where this bitwise process have been written?
OriginalGriff 21-May-12 10:01am    
Sorry, but I don't understand you.
Could you try writing that a bit longer in your native language and run it though google translate to see if that helps?
baskaran chellasamy 23-May-12 2:09am    
sorry for the above question method.my question is
I want to find out how object class is coded and also other built-in classes,enumerations,interface,structure are coded.because i want to learn from root level.please help me
OriginalGriff 23-May-12 3:33am    
If you really want to know the fine detail at that low a level, go and have a look at MONO - the source is available for browsing (.NET source is proprietary to Microsoft) and does the same thing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900