Friday, September 14, 2018

Object Oriented Programming (OOP)

Object Oriented Programming 

Programming is a set of instruction given to the computer to do a particular job. In generally program can be organized as what is happening (Code) and what is being affected (Data). Object Oriented Programming (OOP) is a powerful way to approach that job. When the computer was first invented programming was done by using binary machine instruction. As long as the program has fewer instructions like hundred this approach worked. As programs growth and increasing complexity assembly language was invented. It’s helped programmers to handle large programs using symbolic representations. As the complexity of programs increase high level languages were introduced. When these high level languages began to reach their breaking point structured programming language such as C invented.


Programming Language

Object Oriented Programming Concept


Objects

OOP is based on the concept of ‘objects’. The object is the real life thing which has characteristics and behaviors. In programming that called attributes (variables/data members) and methods (functions).


Object

Class

Class is a specification of an object or template for creation of object.

Class

Using above class lets create object call sam,

Person sam = new Person();

sam is a variable type of class Person. It is a instances of class Person. Using new keyword we can create an end number of objects in the Person class.

Abstraction

Abstraction is a filter out the unnecessary details and capture only the essential features about the object in order to simplify and increase efficiency.


Abstration

Encapsulation

Encapsulation is binds the member function and data member into a single class. In another point it is hiding and protect several data from outside when it's necessary.




Inheritance

Inheritance is a class can ‘Inherit’ properties from another base class and define a new class with added features.




Polymorphism

The concept of polymorphism which means many (poly) forms (morphs).There is a two type of polymorphism,


1. Dynamic polymorphism - runtime time. (Overiding)


2. Static polymorphism - compile time. (Overloading)




No comments:

Post a Comment