OOP Fundamentals

All programs have two things  data and processing part. 

The procedural programming language: focus  on processing part means how to process. it based on top-down design approach.
Object oriented programming language: focus on data part  means whom to process. It based on down-top design approach.

Basic concepts of OOPS.

# Abstraction : hiding details , build in data type also a example of abstraction which hide inside details. object oriented programming language abstracting using object and classes.

## Object: object is a instance of a class, where class is build in data type and object is a variable.
Object have its own:

a) identification
b) property
c) behaviors

## Class represents similar properties and behaviors. Its a blue print to create objects.

# Encapsulation: Encapsulation is process to bind data and code together. it help to hide data by declaring member of class by private and protected. Java class support to bind code and data.

# Inheritance: Inherit properties form base class, types of inheritance in java
a) Single level Inheritance
b) Multi-level Inheritance
c) Hierarchical Inheritance
## java doesnot support multiple inheritance.

# Polymorphism :  OOPS allow following features:
## Operator overloading : multiple use of a single operator like a "+" use to add a int , float and concatenating an string.

## Method  overloading : more then one methods of a same name. The overloaded methods must have different number of parameters or different types of parameters.

### Compile time polymorphism : overloaded method is resolved at compile time known as static binding.
### Run time polymorphism : overloaded method is resolved at run time known as dynamic binding. Java mostly is run time binding.
      
## Method overriding:A class can define a method with the same name as in the super class in derived  class with same number of parameter and same type of parameter. Decision of method overriding  takes normally at run time in java
  
# Persistence : some object oriented language allow user to store in secondary storage, java also allow to store in permanent storage

# Genericity : define a algorithm which is independent on  data type.c++ supports templates like java also support same feature called generics.

#Composite Object : A object might be made of other  objects.

# Composition : The class might be derived from many other class using composition    
   

Comments

Popular posts from this blog

Creational Design Pattern: Factory Design Pattern

Introduction to Java

Design Patterns: The Secret Weapon of Expert Developers