Explain the difference between state, behavior, and identity of an object.
Last updated
State is what an object knows (its field values). Behavior is what it can do (its methods).
Identity is its unique existence independent of state, usually backed by its memory reference.
Two objects can be equal (same state, via
equals()/__eq__) yet not identical (different references, via==/is).
- https://dev.to/singhaayush/mastering-classes-and-objects-step-by-step-for-beginners-28i4
- https://dev.to/paulike/defining-classes-for-objects-15o5
- https://medium.com/@saket_89496/state-property-behavior-and-identity-explained-in-simple-words-b00b935cbf02
- https://medium.com/@byte.talking/object-oriented-programming-oop-in-java-from-fundamentals-to-advanced-concepts-07f0c136487c
- https://www.geeksforgeeks.org/java/what-are-objects-in-programming/
- https://www.geeksforgeeks.org/c-sharp/c-oop-object-oriented-programming-concepts-1/