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