OOP Flashcards

1
Q

What is a method?

A

A function which is a property of an object.

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

How can you tell the difference between a method definition and a method call?

A

Similar to functions —> definitions have function keyword, calls have the (args) sign

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

Describe method definition syntax.

A

Function keyword, opt. Fx name (opt parameters) {code body w/opt return statement}

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

Describe method call syntax.

A

Object.method-to-call(arguments to pass)

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

How is a method different from any other function?

A

It’s identical EXCEPT that it’s a property of an object

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

What is the defining characteristic of OOP?

A

Objects can contain both data (as properties) and behavior (as methods)

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

What are the four “principles“ of OOP?

A

Abstraction, Encapsulation, Inheritance, Polymorphism

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

What is “abstraction”?

A

Being able to work with (possibly) complex things in simple ways —> abstract away the complicated parts.

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

What does API stand for?

A

Application Programming Interface

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

What is the purpose of an API?

A

To give programmers a way to interact with a system in a simplified, consistent fashion (an abstraction)

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