Wednesday, January 29, 2014

Introduction To Object Oriented Concept

INTRODUCTION



OOP (object oriented programming) , The basic concept is that the data and method are operates in a single unit which is also called as Objects. The basic concept is that every thing is a object and has some attributes and behavior. Attributes are the data and Behavior is the function or method.The use OOP provides us the improved software development, Its improved software maintenance ,code reuse which enable fast development and OOP also make the code more easy to understand.The disadvantage of OOP is that it is slower and are large programs.




OBJECTS:



Everything in this universe is the object and has some attribute and behavior. For example: A car is an object. It has tire,engine,steering and gear etc . It has also the behavior that it can start and drive. Similarly, in OOP object is defined.



CLASS:



Class is representation of an type of an objects. Class is a template/blueprint for object. For example: Class in schools/colleges/universities etc contains the object which are students. There are many other classes in schools/colleges/universities etc and in classes there are students which represented in the class.

Class has three things attributes,methods and operations.



ENCAPSULATION:



Encapsulation binds the function and data from the outside data and prevent from misuse. One way to think encapsulation is protective wrapper that prevent the code and data from being arbitrarily accessed by other code defined outside wrapper. For Example: If we shift a gear of car, steering of the car do not turn or brake is not applied and so on.



INHERITANCE:



Inheritance is the process by which one object acquires the properties of another objects. When a class(sub class) is inherit from other class(super class) then the subclass inherit all the attributes and functions of the super class (If the access specifier is not declare as private)



ABSTRACTION:



Abstraction is the essential element of Object Oriented Programming. We may think of a car which has many other complex sets of parts but when we not want to know the complexity of how car driving , engines and other complex part of car. Driver drive car to the destination without thinking of the complexity of how the car is manufacture.Abstraction allows in breaking the system in pieces for extending the functionality and manageable pieces.



POLYMORPHISM:



Polymorphism is a greek word which mean "many forms". It is expressed by "one interface and multiple methods ". This means that that it is possible to design a generic interface to a group a related actitives. This help in reduce the complexity by allowing the same interface to be used to specify a general class of action.



OVERLOADING:



Overloading is the same name of method, but different parameter or arguments. Overloading is also the basic concept of Polymorphism.
Full Post

No comments:

Post a Comment