Difference Between


(1) Object Oriented and Procedure Oriented

Object Oriented Procedure Oriented
In Object Oriented Programming primary focus is on object.
In Procedure Oriented Programming primary focus is on function.
It follows bottom up approach. It follows top down approach.
Primary importance is given to data instead of function.
Primary importance is given to function instead of data.   
The program is divided into small parts Known as object.
The program is divided into small parts  Known as function.
Data can not move freely from one function to another function.
Data moves freely from one function to another function.
It provides data hiding facility.
It does not provides data hiding facility.
Data and functions can be added easily Whenever required.
Data and functions cannot be added easily.
C++, JAVA is the example of Object Oriented Programming Language.
C, COBOL, FORTRAN is the example of Procedure Oriented Programming.

     

(2) Data Abstraction and Data Encapsulation

Data Abstraction Data Encapsulation
Data abstraction refers to the process of providing only essential information to the outside word and hiding their background details.
The process of binding data and its associated function into a single unit is known as data encapsulation.

(3) Cout and Cin

cout cin
cout is known as an output statement.
cin is known as an input statement.
It is used to display the content of the variable or string on the output screen.
It is used to input data into the program.
cout is a predefined object defined in ostream.h which represents the standard output stream in C++ which is monitor.
cin is a predefined object defined in istream.h file which represents the standard input stream in C++ which is keyboard.
Syntax:
cout << Variable_Name or “String”;
Example
cout << “Welcome To C++”;
Syntax:
cin >> Variable_Name ;
Example
cin >>a;

(4) Single Line Comment and Multi Line Comment

Single Line Comment Multi Line Comment
It was introduced in C++ so it is also known as C++ Style comment.
It was introduced in C so it is also known as C Style comment.
It is starts with //.
It is starts with /* and ends with */ symbols.
Example:
// This Program Implements Class
// and Objects
Example:
/* This Program Implements Class And Objects */
We can not use this comment inside C++ statements.
We can also use this comment inside C++ statements.

(5) While Loop and Do While Loop

While Loop Do While Loop
In while loop, condition is checked at the beginning of loop.
In do...while loop, condition is checked at the end of loop.
It is known as entry controlled loop.
It is known as exit controlled loop.
If condition is false at the first trial body of the loop never executes.
If condition is false at the first trial body of the loop executes at least once.
Syntax:
while(condition)
{
Body of loop
}
Syntax:
do
{
Body of loop
} while(condition);

(6) Break and Continue

Break Continue
Break statement is used to transfer control of the program immediately after the loop or switch case statement.
Continue statement is used to skip some part of the loop and transfer control of the program to the next iteration in the loop.

(7) Keyword and Identifier

Normal Function Inline Function
Normal Function decrease execution speed of the program.
Inline Function increase execution speed of the program.
It occupies less memory during runtime as compared to inline function.
It occupies more memory during runtime as compared to normal function.
Normal function can contain any number of statements.
Inline function works fine if it contains only two or three statements.

(8) Public and Private

Public Private
Public members of the class can be accessed directly using object of the class.
Private members of the class can not be accessed directly using object of the class.
Inheritance of public members is possible.
Inheritance of private members is not possible.

(9) Call By Value and Call By Reference

Call By Value Call By Reference
In this method of calling the function values of the original variables is passed to the function.
In this method of calling the function addresses of the original variables is passed to the function using concept of pointer.
As you pass the values of original variables it is copied in the formal parameters of the function. Thus function works with the copy of the original variables. Any changes that are made to the variables inside function do not affect the original variables.
As you pass the addresses of original variables, the function works with the original variables. Any changes that are made to the variables inside function also affect the original variables.
Call by value method can not alter the value of the original variable.
Call by reference method alters the value of the original variable.

(10) Compile Time and Run Time Polymorphism

Compile Time Polymorphism Run Time Polymorphism
Compile time polymorphism is also known as static binding or early binding.
Run time polymorphism is also known as dynamic binding or late binding.
Function overloading and Operator overloading are the example of compile time polymorphism.
Virtual function is the example of run time polymorphism.
In compile time polymorphism which function to invoke is determined at compile time so it is called static or early binding.
In run time polymorphism which function to invoke is determined at runtime so it is called dynamic binding or late binding.

(11) Default Constructor and Parameterized Constructor

Default Constructor Parameterized Constructor
Default Constructor does not accept any arguments.
Parameterized Constructor accept one or more arguments.
It initialize same value for data memeber of different objects.
It can initialize different value for data memeber of different objects.

Widget is loading comments...

Download Projects


Download Programs