OOPS Concepts

 OOPS Concepts


OPPS is basically a concept which is related to the real world. 

Some basic OOPs concepts are as follows:

  1. Class
  2. Object
  3. Data Hiding
  4. Abstraction
  5. Encapsulation
  6. Inheritance
  7. Polymorphism

Class: Class is a group of objects.
Ex: Class

Object: Object is a real World entity.
Ex: Car, TV, Book, etc.

Data Hiding: Data hiding is the concept of hiding data from the unauthorised person/user.
Ex: mail, Bank account.

Abstraction: Abstraction is the concept of showing only essential information to the user and hiding  some data from the user.
Ex: ATM Machine.

Encapsulation: Encapsulation is the concept of wrapping-up of data and it's corresponding behaviour into a single unit.
                                      Encapsulation=Data Hiding +  Encapsulation
Ex: POJO Class.

Inheritance: Inheritance is the concept of parent child relationship, where the child class adopt the feature of the parent class. The parent class is  also known as Base class and the child class is known as Derived class. 
Ex: parent and child.
Inheritance are of 5 types:

  1. Single level inheritance.
  2. Multilevel Inheritance
  3. Multiple Inheritance
  4. Hierarchical Inheritance
  5. Hybrid Inheritance

Single Level Inheritance:
 Where there is only one Base class and one Derived class.

Multilevel Inheritance:
   Where base class inherit it's parent class.

Multiple Inheritance: 
   Where one Derived class can inherit multiple base class .

Hierarchical Inheritance:
    Where we have one base class and multiple derived class.

Hybrid Inheritance: 
     Where one derived class  inherit two base classes.

Polymorphism: Polymorphism is the a Greek world, where "Poly" means " one thing" and "Morphism" means "Many Forms".

In OOP we have two types of Polymorphism:
1.  Static Polymorphism
2. Dynamic Polymorphism









No comments:

Post a Comment

Short note of uml basic building blocks

(SHORT NOTE) Basic building blocks of UML UML(Unified Modeling Language) There are three kinds of building blocks of UML 1...