Introduction:
Object-oriented programming, or OOP, is an approach to problem-solving where all computations are carried out using objects.
Object
An object is a component of a program that knows how to perform certain actions and how to interact with other elements of the program. Objects are the basic units of object-oriented programming.
Example
A simple example of an object would be a person. Logically, you would expect a person to have a name. This would be considered a property of the person. You would also expect a person to be able to do something, such as walking. This would be considered a method of the person.
Method in object-oriented programming
A method in object-oriented programming is like a procedure in procedural programming. The key difference here is that the method is part of an object. In object-oriented programming, you organize your code by creating objects, and then you can give those objects properties and you can make them do certain things. Most modern programming languages including Java C++, C#, Python and PHP are Object Oriented.
Advantages of OOP:
-
OOP provides a clear modular structure for programs.
-
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 implements real life scenario.
-
In OOP, programmer not only defines data types but also deals with operations applied for data structures.
Disadvantages:
-
We can not apply OOP everywhere as it is not a universal language.
-
OOPs take time to get used to it.
-
Everything is treated as object in OOP so before applying it we need to have excellent thinking in terms of objects.
![]() |
Nice 🙂
ReplyDeleteNice professor shab love you❤
ReplyDeletethis things is cool ,professor what about next ?
ReplyDeleteI mean blogposts.