Object Oriented Programming Language

Procedure Oriented Approach :
High level languages provide easy approach to users in developing their logic to solve any problem with the help of these programming language. These procedural programming language allows the user by applying number of functions to enable program productivity i.e. more stress is given on procedure.
Examples: BASIC,COBOL,C,FORTRAN.

Object Oriented Approach :
OOP is an approach to standardize he program by creating memory area for both data and functions. It gives stress on data items rather than the procedure. It does not allows the data to flow freely from one function to other. The complete problem is decomposed into number of small entities known as objects. It is modular approach which also provides the reusability feature.
Examples:C++,JAVA,Small Talk,SIMULA-67.

Elements or principles or concepts of OOP language
  1. OBJECT : Object is a unique entity which contains data and functions together in a language. In real world data is reffered to the characterstics and functions are the behaviours. The set of related objects may exchange data and information and can interact with each other.
    Example: Real world-Book
    Characterstics are it has chapters,pages,topics and Behaviour is that is is used to read or to make notes.
    Software object-Book
    data members are name,writter,price and functions are acceptdata(),display()
  2. CLASS : Class is the set of similar objects. The attributes and behaviour of objects are defined within the class. It does not allocate any memory without its object.
    Example : class Television
    Attributes (data values) - company,model_no,colour,size,price
    Functions - getdata() , display()
  3. ENCAPSULATION : System of wrapping of data and functions into single unit i.e. class is known as encapsulation.
    Example : A remote control of a television. Various functions og TV are linked with the remote control of 'that' TV.
    DATA HIDING : Insulation of data which cannot be accessed directly outside the class although they are present in the same program.
  4. ABSTRACTION : Abstraction refers to act of representing the essential features without including the background details.
    Example : To drive a car we should know about essential features like how to accelate, apply brakes and how to change the gears. No importance is given to changes taken place in the machinery part of the engine.
  5. INHERITANCE : Inheritance is the process by which objects of one class can link and share some common properties from objects of other class.
    Example : Figure circle is the part of clas two dimensional which in turn is the part of class mensuration.
    Inheritance uses reusability feature.
  6. POLYMORPHISM : Polymorphism is the process of using one function for more than one purpose. It allows the use of different internal structure of object by keeping the same external interface.
    Example : If '+' symbol is applied between two integers than it performs the addition of those numbers and if it is applied between two strings then it concatenates the strings.

No comments:

Post a Comment