OOPS Concept Tutorial


Class: It is a template / skeleton for creating an object.

Object: An Object is an entity that has properties for validations, methods for functionality and events for depicting the change of state.

Every object has the data and behavior with which they are differed. Data associated at any given instance of time is the state of an object.

An application can be called as a collection of related objects exchanging messages with each other.

Loosely coupled objects are better than tightly coupled objects i.e. the lesser the information given to other objects the better it is as the objects are loosely coupled the dependencies are less and stronger security.

Every object oriented language should have three features
  • Encapsulation
  • Inheritance
  • Polymorphism

Encapsulation: Binding of data and behavior which is the functionality of an object within a secured and controlled environment is encapsulation.

Inheritance: The Process of acquiring the existing functionality of the parent and with new added features and functionality by a child object is called inheritance.
The advantages of inheritance are Generalization, Extensibility and Reusability.
For example: A calculator is a generalized form of mathematical operations where as a Scientific calculator is an Extended and Specific form.

Polymorphism: An object which has different forms and exhibits the same functionality for all those forms but implementes them in different ways.
For example: A man who knows more than one language can speak any language he knows. Here the functionality is speech and person is the object.

Comments