DEV Community

Discussion on: Questions about OOP , basics, OOPS?

Collapse
 
maureento8888 profile image
Maureen T'O

What are the four pillars to OOP? What do they do and how might you implement them?

Collapse
 
erikaronszabo profile image
Erik-Aron-Szabo

thank you

Collapse
 
erikaronszabo profile image
Erik-Aron-Szabo

Abstraction:
allowing necessary portions to be visible, hiding the inner workings of a class

Encapsulation:
Wrapping up the methods and attributes of the class within the class
(Example: If it's a VEGGIE wrap...you don't put chicken meat in the wrap. You put it in the MEAT wrap)

Inheritance:
Is when an object acquires the property of another object.

Polymorphism:
Classes that inherit from each other, being able to use the same method and receive a different result.
(Example: There is a kitchen knife, some use it to cut chicken breast, some use it to cut cart boxes)

(These might not be 100% accurate)