Object Identity

Every object is its own separate thing, even if its data matches another object.

What is Object Identity?

Object identity means every object is a separate thing, even if its data matches another object's. Two Coin objects both worth 25 cents are still two coins.

var a = new Coin(25);
var b = new Coin(25);
Console.WriteLine(ReferenceEquals(a, b)); // False: two different objects

Level: Apprentice · More OOP terms at this level

Updated