Access Modifiers Flashcards

1
Q

Access to the class member must be inherited from the declaring class/superclass.

A

Protected

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

Class member may be accessed from anywhere in the program.

A

Public

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

Access is limited to within the package, class member is not accessible from outside its package.

A

Blank (no modifier)

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

Access is limited to the declaring class itself.

The class member is only accessible from within the class it was declared in.

Members are not accessible from outside the class, including subclasses.

A

Private

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

Identify the modifier:

Who has Access:
Subclasses of the Superclass within the same package.

Subclasses of the Superclass that are outside of the package.

Classes within the same package as the Superclass.

Who has NO Access:
Classes outside the package of the Superclass.

A

Protected

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

Identify the modifier:

Who has Access:
The class itself in which the member was declared.

Who has NO Access:
Classes where the member is not declared in.

A

Private

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

Identify the modifier:

Who has Access:
Classes within the package the member was declared in.

Who has NO Access:
Classes outside the package the member was declared in.

A

Blank (no modifier)

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