|
Answer» 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.
A class represents description of objects that share same attributes and actions. It defines the characteristics of the objects such as attributes and actions or behaviors. It is the blue print that describes objects.
Method is an object’s behavior. If you consider “Dog” as an object then its behaviors are bark, walk, run etc. 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.
A class represents description of objects that share same attributes and actions. It defines the characteristics of the objects such as attributes and actions or behaviors. It is the blue print that describes objects.
Method is an object’s behavior. If you consider “Dog” as an object then its behaviors are bark, walk, run etc.
|