Object Oriented Terminology Flashcards

1
Q

What is a Class?

A

The blueprint to create an object

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

What is an object?

A

An instance of a class

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

What is encapsulation?

A

Assigning levels of access to variables, methods and classes

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

What is the benefit of inheritance?

A

Gives the program robustness for reuse / future use

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

What is inheritance?

A
  • Derives new classes from existing classes
  • Subclass retains specific attributes and methods from the superclass
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the 4 different access levels provided by encapsulation?

A
  • Public can be used by any class from any package
  • Private can only be used by the current class
  • Protected can only be used via inheritance from the current class
  • Package-wide (Default) allows all classes inside the current package to access
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is meant by the Static components of a class?

A
  • Variables and methods from the class
  • When called by an object, these static components are run from the class, not the object
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is meant by the non-static components of a class?

A
  • Non static components are copied into the objects when instantiated
  • These are called from the objects when run
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the purpose of a “getter” or “accessor” method?

A

To return the value of an attribute in a private class

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