Why does == not work while comparing two object type variables boxed with same int value
问题 While trying to implement a simple singly linked list in C#, I noticed that == does not work while comparing two object type variables boxed with an int value but .Equals works. Wanted to check why that is so. The below snippet is a generic object type Data property public class Node { /// <summary> /// Data contained in the node /// </summary> private object Data { get; set; }; } The below code traverses the singly linked list and searches for a value of type object - /// <summary> ///