E-Mail:
Author Avatar

.NET Objects Tip - Object Identity vs. Object Equality - Virtual Method Equals in System.Object

From what I have been told, understanding the basics of .NET objects has to be one of the biggest challenges to consider when looking at two different descriptions for .NET objects.

Here is an interesting description of the differences between Object Identity and Object Equality pertaining to objects in the .NET Framework.

Generally speaking, two objects are identical if they share the same address in memory. This means that they are both referring to the same instance of a class. You can test if two objects are identical by using the ReferenceEquals static method of System.Object: Object.ReferenceEquals(myFirstObject, mySecondObject).

On the other hand, two objects are equivalent if they are instances of the same type and if every field of the first object matches the value of the same field of the second object…. Source: davidhayden.com/blog

Tags: , , ,

What Do You Think?

 


Anti-Spam Image

Want to Start a Blog Here for Free?

Are you an expert in one subject or another? If your goal is to help others and dispense hard-earned information back to the community, stake a claim on your very own Lockergnome blog today! You can write about anything - no matter the topic. Sign-up to start blogging!

Author Avatar
Flash, SEO - Aug 6, 2008

Flash And SEO: Like Oil And Water

57 queries / 0.293 seconds.