Every object has : state, behavior and identity -
explain

Answer Posted / benjamin jacob



Identity : Every instance of a class should be unique. e.g.
in memory, every object has its own memory address. This is
part of the unique id, other than which a user can have
member variables uniquely identifying the instance of the class.

State : Every object, at any given point of time would have
to have a set of attributes defining its State.

Behavior : Every object based on its state and optionally
identity will have particular behavior.

Is This Answer Correct ?    85 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What's the order of call of constructors in inheritiance?

594


Explain about multiple inheritance?

637


What is the difference abstract class and interface?

543


What are abstract methods?

604


What is the base type from which all structs inherit directly?

550






Explain about overriding polymorphism?

594


Why do we separate interface from implementation?

556


What are all the operators that cannot be overloaded?

560


Tell me something about abstract classes?

578


What is the difference between abstract & interface?

588


Which oops concept exposes only necessary information to the calling functions?

575


What are extrinsic and intrinsic connections in object-oriented programming?

553


What is the benefit of using inheritance?

599


Explain about inheritance?

651


What is garbage collection(gc)?

587