Friday, December 26, 2014

Object oriented programming language

An object is considered as a real world entity. Object is an instance of a class. Any programming language in the world which satisfies the object oriented features is considered as a object oriented programming language i.e every program developed using the concerned programming language must fallow the basic concepts that are stated in Oops. The fallowing are the basic concepts of oops:
  • Class
  • Object
  • Inheritance
  • Polymorphism
  • Abstraction
  • Encapsulation

Class

A class is a logical one which cannot be visible. A class contains variables and methods. A class  is a model for creating objects.

Object

An entity which has a specific structure and behaviour is called as an object. For example: chair, pen, table, keyboard, bike etc. It can be physical and logical.

Inheritance

  The process of deriving a new class from the existing class is called inheritance. In this context the new class is called derived class and the existing class is called as base class. The derived class will acquire all the properties and behaviours of the base class. Using inheritance we can achieve code reusability. It is also used to achieve runtime polymorphism.

 Polymorphism
 An Object which exhibits multiple behaviours is called as polymorphism. Polymorphism is derived from the Greek word where poly means many morphic means forms. Using method overloading and method overriding we can achieve polymorphism.
Abstraction:
Hiding the internal details of a programme but displaying the functionality is called  abstraction.
Encapsulation:
The process of binding the member variables with the methods of a class is called encapsulation. Java beans is the best example for encapsulation.

No comments:

Post a Comment