Object-oriented programming (OOP) structures programs around objects rather than functions and logic. OOP focuses on objects that have attributes and functions to represent and manipulate data. Classes act as blueprints that define objects, while abstraction, encapsulation, inheritance, and polymorphism are key concepts. Abstraction hides unnecessary details, encapsulation wraps data and functions together, inheritance establishes a parent-child relationship between classes, and polymorphism allows one function to have multiple definitions. Benefits of OOP include code reusability, easier maintenance through classes and objects, data hiding for security, and ease of implementation.
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
55 views
Object Oriented Programming
Object-oriented programming (OOP) structures programs around objects rather than functions and logic. OOP focuses on objects that have attributes and functions to represent and manipulate data. Classes act as blueprints that define objects, while abstraction, encapsulation, inheritance, and polymorphism are key concepts. Abstraction hides unnecessary details, encapsulation wraps data and functions together, inheritance establishes a parent-child relationship between classes, and polymorphism allows one function to have multiple definitions. Benefits of OOP include code reusability, easier maintenance through classes and objects, data hiding for security, and ease of implementation.
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6
Object Oriented Programming
Concept Of Object Oriented
Programming oop is an approach or a Programming pattern where the programs are structured around objects rather than functions and logic. It makes the data partitioned into two memory areas, i.e., data and functions, and helps make the code flexible and modular. Object-oriented programming mainly focuses on objects that are required to be manipulated. In OOPs, it can represent data as objects that have attributes and functions. Basic Object-Oriented Programming Object-An O Object can be defined as an entity that has a state and behavior, or in other words, anything that exists physically in the world is called an object. It can represent a dog, a person, a table, etc. An object means the combination of data and programs, which further represent an entity. Classes-Class can be defined as a blueprint of the object. It is basically a collection of objects which act as building blocks. Abstraction- Abstraction helps in the data hiding process. It helps in displaying the essential features without showing the details or the functionality to the user. It avoids unnecessary information or irrelevant details and shows only that specific part which the user wants to see. Basic Object-Oriented Programming Encapsulation- The wrapping up of data and functions together in a single unit is known as encapsulation. It can be achieved by making the data members' scope private and the member function’s scope public to access these data members. Encapsulation makes the data non- accessible to the outside world. Inheritance- Inheritance is the process in which two classes have an is-a relationship among each other and objects of one class acquire properties and features of the other class. The class which inherits the features is known as the child class, and the class whose features it inherited is called the parent class. For example, Class Vehicle is the parent class, and Class Bus, Car, and Bike are child classes. Polymorphism- It means many forms. It is the ability to take more than one form. It is a feature that provides a function or an operator with more than one definition. It can be implemented using function overloading, operator overload, function overriding, virtual function. Advantages of OOPs There are various advantages of object-oriented programming. OOPs provide reusability to the code and extend the use of existing classes. In OOPs, it is easy to maintain code as there are classes and objects, which helps in making it easy to maintain rather than restructuring. It also helps in data hiding, keeping the data and information safe from leaking or getting exposed. Object-oriented programming is easy to implement.