Classes and Objects 04 Flashcards

1
Q

How does the use of private and public access modifiers assist encapsulation?

A

Private access modifiers are used to help classes hide there internal data representation.

While the implementation details are now hiden the class provides a public interface that allows users to modify/access the internal state.

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

What does encapsulation do?

A

It ensure object’s are self contained and reusable.

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