OOP Flashcards

1
Q

What is Encapsulation?

A

The process of storing functions (methods) with their associated data (properties) in on thing (object).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why use Encapsulation?

A

Makes it easier to add new functionality (properties/methods).

Makes it easier to read through what was already coded.

Made it so you were not afraid to make changes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Abstraction?

A

Hiding the details, and just showing what is essential.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why use Abstraction?

A

Allows for smaller more manageable pieces of code.

Helps you to split the complexity of your software project into manageable parts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Inheritance?

A

Make a class from another class for a hierarchy of classes that share a set of properties and methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why use Inheritance?

A

Eliminates a lot of redundant code. (keep code DRY).

Easier to change/add/remove functionality (properties and methods).

Easier to read/keep track of what’s going on.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Polymorphism?

A

Code written to use an interface (property/method) automatically knows how to work with any number of different objects that provide the interface (property/method).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why use Polymorphism?

A

Provides a way to perform a single action in different forms.

Provides an ability to call the same method on different JavaScript objects.

Also, makes your code more reusable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly