![]() two objects being equal but having different representation, e.g., a $1 bill and a $1 coin.two objects being equal but distinct, e.g., two $10 banknotes.two different objects of the same type, e.g., two hands.It is often necessary to distinguish between: Sometimes, particularly in object-oriented programming, the comparison raises questions of data types and inheritance, equality, and identity. One possible meaning of equality is that "if a equals b, then either a or b can be used interchangeably in any context without noticing any difference." But this statement does not necessarily hold, particularly when taking into account mutability together with content equality. ![]() It is used in switch statements to dispatch the control flow to the correct branch, and during the unification process in logic programming. It is used to test if an element already exists in a set, or to access to a value through a key.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |