0% found this document useful (0 votes)
8 views3 pages

OOPS BASICS PDF

Object-Oriented Programming (OOP) is a programming paradigm that utilizes objects to represent data and methods. Key concepts include classes and objects, inheritance, polymorphism, and encapsulation, which promote code reusability and data protection. Python supports OOP, allowing developers to create classes, inherit attributes, and implement methods across different classes.

Uploaded by

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

OOPS BASICS PDF

Object-Oriented Programming (OOP) is a programming paradigm that utilizes objects to represent data and methods. Key concepts include classes and objects, inheritance, polymorphism, and encapsulation, which promote code reusability and data protection. Python supports OOP, allowing developers to create classes, inherit attributes, and implement methods across different classes.

Uploaded by

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

Object-Oriented Programming (OOP) is a programming paradigm that uses "objects" to represent

data and methods to manipulate that data. Python is a multi-paradigm programming language that
supports OOP. The main concepts of OOP include:

1. Classes and Objects:

• Class: A blueprint for creating objects. It defines a set of attributes and methods that
the created objects (instances) will have.

• Object: An instance of a class. It is created from a class and can have its own unique
attributes and states.

Inheritance:

• Inheritance allows a class (child class) to inherit attributes and methods from another class
(parent class). This promotes code reusability.

Polymorphism is a core concept in Object-Oriented Programming (OOP) that allows objects of


different classes to be treated as objects of a common superclass. The term "polymorphism" comes
from the Greek words "poly" (meaning many) and "morph" (meaning forms). In programming, it
refers to the ability of different classes to provide a unique implementation of methods that share
the same name.

Encapsulation:

• Encapsulation is the bundling of data (attributes) and methods (functions) that operate on
the data into a single unit or class. It restricts direct access to some of the object's
components, which can prevent the accidental modification of data.

Summary of OOP Principles:


• Classes and Objects: Create classes to define objects.

• Inheritance: Create a new class from an existing class.

• Polymorphism: Use the same method name for different classes.

• Encapsulation: Hide the internal state and require all interaction to be performed through an
object's methods.

You might also like