Encapsulation Flashcards

1
Q

means hiding the structure and implementation of an object while
exposing only the essential features (interface) in the perspective of the user(s) of the object.

A

Encapsulation

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

means protecting your class or its instances from abuse or misuse.

A

Encapsulation

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

How to do we protect classes and attributes?

A

1) By making attributes private
2) By selectively making methods private
3) Through structural hierarchy (organizing classes into packages)

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

A feature can be declared with an ______________ to alter its visibility with respect to other classes

A

access modifier

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

What type of access modifier?

Others can use it

A

Public

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

What type of access modifier?

Package-mates can use it

A

Default

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

What type of access modifier?

Only the class can use it

A

Private

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