0% found this document useful (0 votes)
18 views8 pages

What Is OOP (Object Oriented Programming)

OOP is a programming paradigm organized around objects rather than actions and data rather than logic. The key concepts of OOP are encapsulation, abstraction, inheritance, and polymorphism. Encapsulation wraps data and functions together, abstraction provides only essential information to outside objects, inheritance allows classes to inherit properties from parent classes, and polymorphism allows objects to take on multiple forms. OOP provides modularity, reusability, and security through these concepts.

Uploaded by

g8mmkdnjyp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views8 pages

What Is OOP (Object Oriented Programming)

OOP is a programming paradigm organized around objects rather than actions and data rather than logic. The key concepts of OOP are encapsulation, abstraction, inheritance, and polymorphism. Encapsulation wraps data and functions together, abstraction provides only essential information to outside objects, inheritance allows classes to inherit properties from parent classes, and polymorphism allows objects to take on multiple forms. OOP provides modularity, reusability, and security through these concepts.

Uploaded by

g8mmkdnjyp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

What is OOP(object oriented programming)

Object-oriented programming (OOP) is a programming language model


organized around objects rather than "actions" and data rather than logic.
Historically, a program has been viewed as a logical procedure that takes
input data, processes it, and produces output data.
In brief Concepts of OOP are

-Data Encapsulation : Wrapping of functions with its associated data.


-Data Abstraction : Providing only essential information about the data to the
outside world
-Inheritance : The properties of one class can be inherited by the other.
-Polymorphism : The ability of a variable, function or object to take on multiple
forms.
Encapsulation means wrapping up of data members and methods into a single unit. And also protecting the
data members from outside world so they are not directly accessible from outside world.

For example, all functionalities of a phone encapsulated in a software i.e. Android or iOS etc.

We can't directly use any feature of software

To use that, we are provided with an object in form of phone.

What encapsulation gives?

It gives modularity and security.


Inheritance is a very important and important part of OOP. The function of Inheritance is to reuse a
built-in class. For example, after creating classes to score for an entire school, simply create a class
school and extend class A, class B, and so on to get data from class A and class B. The data obtained
can be reused and you have the right to change it if you wish. In the C ++ programming language, an
Inheritance Derived class can link to any of the other Derived classes.

In the Dart Programming Language, both Class 2 and Class 1 above cannot be linked, as in Derived
class 3, as shown in C ++. Only one class can be linked. In Dart, the parent class can be called back
with the super keyword, and the child or current class can be used with this.
polymorphism refers to a programming language's ability to process objects differently
depending on their data type or class. More specifically, it is the ability to redefine
methods for derived classes.

Polymorphism is considered as one of the important features of Object Oriented


Programming. Polymorphism allows us to perform a single action in different ways. In
other words, polymorphism allows you to define one interface and have multiple
implementations. The word “poly” means many and “morphs” means forms, So it means
many forms.
In Java polymorphism is mainly divided into two types:

Compile time Polymorphism


Runtime Polymorphism

Compile time polymorphism: It is also known as static polymorphism. This type of polymorphism is
achieved by function overloading or operator overloading.

Method Overloading: When there are multiple functions with same name but different parameters then these
functions are said to be overloaded. Functions can be overloaded by change in number of
arguments or/and change in type of arguments.

Operator Overloading: Java also provide option to overload operators. For example, we can make the
operator (‘+’) for string class to concatenate two strings. We know that this is the addition operator whose task
is to add two operands. So a single operator ‘+’ when placed between integer operands, adds them and when
placed between string operands, concatenates them.In java, Only “+” operator can be overloaded:
To add integers
To concatenate strings

Runtime polymorphism: It is also known as Dynamic Method Dispatch. It is a process in which a function
call to the overridden method is resolved at Runtime. This type of polymorphism is achieved by Method
Overriding. Method overriding, on the other hand, occurs when a derived class has a definition for one of the
member functions of the base class. That base function is said to be overridden.
Why do we study OOP? Because it is the most widely used programming paradigm
throughout the IT industry, and it has been for the past three decades. And it is the only practical
way to manage the complexity of large applications and systems. The procedural paradigm collapses
under the weight of extreme code size. The functional paradigm has not yet been proven for
handling large-scale software.
Because nearly all of the major programming languages we use today are OOP-based:
Java
Python
C#
C++
PHP
Ruby
Perl
Objective-C
Swift
Scala – multi-paradigm
Groovy
Delphi
The advantages of OOP(Benefits of OOP)
-OOP provides a clear modular structure for programs.
-It is good for defining abstract data types.
-Implementation details are hidden from other modules and other modules has a clearly defined
interface.
-It is easy to maintain and modify existing code as new objects can be created with small differences
to existing ones.
-objects, methods, instance, message passing, inheritance are some important properties provided
by these particular languages
-encapsulation, polymorphism, abstraction are also counts in these fundamentals of programming
language.
-It aims to implement real life scenario.
-In OOP, programmer not only defines data types but also deals with operations applied for data
structures.

You might also like