Object oriented programming - Objects and Classes [C++]
Object oriented programming is all about representing the parts of
the problem statements as `objects` and having them interact with
each other (by calling function(s) of the object in question).
Every object has a type. The type of an object is often called a
`class` in object oriented programming. The class contains the list
of characteristics of the object and the functions which the object
is capable of performing.
We can have many objects of a particular class. All the objects of
a particular class are bound to have identical characteristics and
functionalities.
The classes we define to represent our problem elements are similar
to the built in data types like float, int etc. A floating point number,
for example, also has a set of characteristics and behaviors.
The difference is that a programmer defines a new class to fit a new
problem rather than being forced to use an existing data type that
was designed to represent a storage unit.
Reference:
Thinking in C++ (Vol 1) - Bruce Eckel
the problem statements as `objects` and having them interact with
each other (by calling function(s) of the object in question).
Every object has a type. The type of an object is often called a
`class` in object oriented programming. The class contains the list
of characteristics of the object and the functions which the object
is capable of performing.
We can have many objects of a particular class. All the objects of
a particular class are bound to have identical characteristics and
functionalities.
The classes we define to represent our problem elements are similar
to the built in data types like float, int etc. A floating point number,
for example, also has a set of characteristics and behaviors.
The difference is that a programmer defines a new class to fit a new
problem rather than being forced to use an existing data type that
was designed to represent a storage unit.
Reference:
Thinking in C++ (Vol 1) - Bruce Eckel
Total Comments 1
Comments
-
Updated the blog with some sensible (IMO) information.
Posted 11-29-2012 at 03:15 AM by Aquarius_Girl