OOP is in contrast with procedural programming, where programmers select primitive data types, then focus on the step by step procedure to solve a problem
OOP relies on the concept of classes and objects, where programmers analyze the nature and relationships among different classes and objects. The focus is on modeling a subset of the world such as a school, a bank, a company or a store
Real-world objects have states and behaviors, in software these are turned into variable values and methods. So OOP is a matter of designing variables and methods.
Four principles of OOP
Encapsulation: lock information in an object, only exposing services or actions as necessary
Inheritance: child classes inherit data and behaviors from parent class to promote code reuse
Polymorphism: many varieties of a certain behavior to allow flexibility
Abstraction: only exposing high level public methods for accessing an object, just as how people drive different cars using the same set of tools of a steering wheel, the dashboard, a brake and a gas pedal.
Real-world objects contain ___ and ___.
A software object's state is stored in ___.
A software object's behavior is exposed through ___.
Hiding internal data from the outside world, and accessing it only through publicly exposed methods is known as data ___.
A blueprint for a software object is called a ___.
Common behavior can be defined in a ___ class and inherited into a ___ class.