Object Oriented Programming Flashcards

1
Q

What does the (+) symbol tell us in a diagram?

A

An instance variable or method is public.

This means it can be fully accessed and used by other objects.

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

What does the (-) symbol show us in a UML diagram?

A

That an instance variable or method is private.

This means it cannot be directly accessed or used by other objects.

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

What is the purpose of encapsulation?

A

To make changes to private properties using the methods provided.

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

What is a sub-class?

A

A class that is derived from an existing class.

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

What is the purpose of inheritance?

A

To copy all of the data items and methods from the superclass when a sub-class is created.

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

What does polymorphism allow?

A

Different sub-classes and the superclass they are derived from to behave differently when the same method is invoked.

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

What does an array of objects allow in OOP?

A

An instance variable to become an array which contains several instances of another class.

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