Question

Explain, compare and contrast Procedural Programming with Object Oriented Programming concepts. Provide examples.

Explain, compare and contrast Procedural Programming with Object Oriented Programming concepts. Provide examples.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Procedure Oriented Programming -POP

Object Oriented Programming -OOP

1

In POP, program is divided into small parts called functions.

In OOP, program is divided into parts called objects.

2

In POP,Importance is not given to data but to functions as well as sequence of actions to be done.

In OOP, Importance is given to the data rather than procedures or functions because it works as a real world.

3

POP follows Top Down approach.

OOP follows Bottom Up approach.

Explanation

Top down approach and bottom up approach are involved in software development. These approaches are not involved in program execution.

Top down approach begins with high level design and ends with low level design or development. Whereas, bottom up approach begins with low level design or development and ends with high level design.

4

POP does not have any access specifier.

OOP has access specifiers named Public, Private, Protected, etc.

Example:

class Sample{

private String school=null;

public String surName=null;

protected String name=null;

}

5

In POP, Data can move freely from function to function in the system.

In OOP, objects can move and communicate with each other through member functions.

6

In POP, Most function uses Global data for sharing that can be accessed freely from function to function in the system.

In OOP, data can not move easily from function to function,it can be kept public or private so we can control the access of data.

7

POP does not have any proper way for hiding data so it is less secure.

OOP provides Data Hiding so provides more security.

Example:

class Sample{

private String name;

}

Here we declare name as private variable which means it is accessble in this particular class only,and not accessble from any where.

8

In POP, Overloading is not possible.

In OOP, overloading is possible in the form of Function Overloading and Operator Overloading.

Explanation:

Method Overloading is a feature that allows a class to have two or more methods having same name, if their argument lists are different.

class DisplayOverloading
{
    public void disp(char c)
    {
         System.out.println(c);
    }
    public void disp(char c, int num)  
    {
         System.out.println(c + " "+num);
    }
}

here we have two methods with same names and with different parameters.

9

Example of POP are : C, VB, FORTRAN, Pascal.

Example of OOP are : C++, JAVA, VB.NET, C#.NET.

Add a comment
Know the answer?
Add Answer to:
Explain, compare and contrast Procedural Programming with Object Oriented Programming concepts. Provide examples.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT