An object combines an identity, state and operations exposed through an object interface. Distinct software objects can hold equal data while remaining different by object identity. Reference aliasing occurs when multiple references designate the same object, so a state update through one reference can affect observations through another.
Equality according to the abstract content a software class exposes, rather than object identity. Distinct software objects can be equal by value. A Java equals(Object) override should define an equivalence relation and agree with its hash code. Equal content can have different internal subdivisions: occupied colour runs, for example, can be equal despite different brick boundaries.
A named software object instantiated once in the scope of its definition. A top-level Scala object can implement the singleton pattern. Nested object definitions can have different instances for different enclosing instances, so the relevant scope matters.
An operation invoked on a software object that can read or modify that receiver's state. Its contract specifies accepted inputs and effects. Dynamic dispatch can select an overriding implementation according to the receiver's concrete software class; method overloading instead selects among different signatures using static type information.

Ancestors (4)

  1. Object-oriented programming
  2. Programming language
  3. Computer science
  4. Home

Synonyms (1)

Discussion (0) New discussion

There are no discussions about this article yet.

Articles by others on the same topic (0)

There are currently no matching articles.