Professional Documents
Culture Documents
What is an object?
An object is a real world entity which have some characteristics and behavior. It
is an instance of a class.
Eg: Dogs have state (name, color, breed, hungry) and behavior (barking, fetching,
wagging tail).
What is a class?
Class is a group of similar objects. It acts as a blueprint based on which the objects
are created so it is known as an object factory.
Eg: Let us consider a class called Car based on which different manufactures build
cars sharing some common properties.
(Lesson 3 Continued…)
Class as user defined data type – When a user creates a class it becomes a data
type for the program. We can use the class to create objects of class type.