OOP Concepts Flashcards
What are the 4 concepts
Abstraction, Encapsulation, Polymorphism, Inheritance.
Goals of OOP
Robustness, Reusability, Adaptability, Modularity
Abstraction
Using simple things to represent complexity.
ie Hide complexity using simple “black boxes”.
Things like objects, classes, and variables represent more complex underlying code and data.
Encapsulation
Keep fields within a class private, then providing access to them via public methods.
Inheritance
Create new classes that share some of the attributes of existing classes.
Why Abstraction
Hide unnecessary details and complexity from users.
Why Encapsulation
We can re-use objects like code components or variables without allowing open access to the data system-wide.
Why Inheritance
Allows us to build on previous work without reinventing the wheel.
Polymorphism
Allows programmers to use the same word to mean different things in different contexts.