Object-Oriented programming emphasis on data rather than function.
Object-Oriented programming was developed due to the limitations of the traditional programming approaches. The traditional programming approaches, such as Pascal, C, BASIC, FORTRAN and etc., are basically called procedural-oriented programming languages.
Procedural-oriented programming basically emphasis on writing a list of instructions to tell the computer to do something: Get some input, add these numbers, divide by 6, display that output. The programs are dividend into a small subprogram know as a function. Most of functions share global data, if program is too large it is very difficult to identify what data is used by which function. It does not model real world problem, and new enhancement is not easy, whole will be changed or new will be develop.
Object-Oriented Programming emphasis on data rather than function. It divides programs into objects, and they can communicate with each other. It provides the concept to hide the data from the external function and program. New data and functions can be easily added rever necessary. Some fundamental features of Object-Oriented programming are:
.” Concept
We’ll be covering the following topics in this tutorial:
Elements of Object-Oriented programming
» Member data
A member data is a data hold by an entity (or object).
» Methods
A method is an operation on the member data. Also known as member function.
» Objects
An Object is a real world entity, combine the data and member function in a single unit.
» Classes
Class is a set of similar types of objects.
Characteristics of Object-Oriented Programming
» Encapsulation
Encapsulation is a mechanism of binding the member data and member function in a single unit.
» Data Abstraction
Data abstraction is mechanism to provide the. Essential feature without describing the background details. Means providing the func1ions to access the hidden (private) data.
» Inheritance
Inheritance is a mechanism of sharing the member data and member function among the classes.
» Polymorphism
Polymorphism is a property to share a single item (or name) in more than one form. (such as function overloading, operator overloading, virtual functions)