PepeMo Talk Live!

Main Menu

Brief post about Object Oriented Programing concepts

Started by Kavindu123, Jul 16, 2023, 02:30 PM

Previous topic - Next topic


Object oriented programing (OOP) means the concept that uses objects to organize the code. There are main OOP concepts as Abstraction, Encapsulation, Inheritance, Polymorphism.

Let's have a look on Abstraction.
Abstraction focuses on the representing the essential features of objects while tends to hide unnecessary details.  Simply use to remove complexity, use to not display complexity to user as well.

Let's have a look on Encapsulation.
This means the biding of data and methods or functions into a one single unit. Use by considering the security of a class. Access modifiers are used in Encapsulation to control visibility. 3 access modifiers are used by this concept as
- Public : Access from anywhere, that means access within the class and outside from the class
- Private : Only accessible within the class
- Protected : Accessible within the class

Let's have a look on Inheritance.
This concept allows the creation of new classes(child classes) based on existing classes(parent classes). Simply this means Child class inherit properties and behaviors from the parent class

Let's have a look on Polymorphism.
This means enables objects of different classes as to be treated as objects of common super class. simply this method contains two methods as method overriding and method overloading.

Thank you very much for reading my post. If you like please drop a comment.