Explain an object.
An object is an entity that keeps together state and behaviors.
For instance, a car encapsulates state such as red color, 900 cc etc and
behaviors as 'Start', 'Stop' etc., so does an object.
An object is an instance of a class. If you consider “Dog” as a class, it will
contain all possible dog traits, while object “German Shepherd” contains
characteristics of specific type of dog.
|