Geeks With Blogs
Dheeman Dutta Just Another Blog..... December 2006 Entries
Identity among Objects
Objects static method ReferenceEquals() uses == oprator to compare two references. The C# compiler generates the IL that is being generated when two objects are being compared with == operator like (obj1==obj2). But there a catch to the whole thing... You can write either ReferenceEquals() or == to compare two objects,, as you prefer them.However you need to very careful. The == operator is guaranteed to check identity only if the variables on both sides of the == operator are of the System.Object ......

Posted On Friday, December 29, 2006 5:27 AM

Copyright © Dheeman Dutta | Powered by: GeeksWithBlogs.net