navbar

Sunday, 6 September 2020

INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) IN EASIEST LANGUAGE

INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING

Object-Oriented Programming is also called OOP.

 Definition :

The Object-oriented progamming (OOP) is a programming methodology that helps to organize set of instructions in a proper sequence to develop program or software.

The Great advantage of OOP

The main and great advantage of OOP are to make complex software faster to develop and easier to maintain.

It also enables the easy reuse of code by applying simple and widely accepted rules of OOP principles.

so...

WHAT IS THE PRINCIPLES OF OOP ?

There are four types of OOP Principle -

1)Abstraction

It is an act of representing essential feature without including background detail and explaination.

2)Encapsulation

The act in which data and method are combined together in the form of single unit is known as encapsulation.

For example :

You are very much familiar with medicines. A capsule is also a medicine which contain combination of many medicine in the form of powder(encapsulated form of medicine). Same as when many object are combined/encapsulated to form a single object is called encapsulation.

3)Inheritance

When one class requires the property of other class is called inheritance.

Base Class : The existing class whose properties are inherited by some other class is known as base class or super class.

Derived Class : The class that acquire the property from existing class is known as derived class or sub class.

For example :

lets take a example from real world please dont mind suppose your father is a super class and you as child is sub class and its obvious that some properties or habits of your father is inherited to you so..thats called inheritance.

4)Polymorphism

When one class is having many form means when one function behave differently in a same class.

For example : The color class may have a method named Paint()

that can be used to paint various color as shown...


.....................................................end...............................................

No comments:

Post a Comment