Private Access Flashcards

1
Q

Remind me of the definition of a private method !

A

A private method is a method that can only be accessed from within the same class

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

Write and run an example to test all the possible scenarios involving a private method !

A

All the possible ways a private method may be attempted to gain access to are :
- from within the same class
- from a class within the same package
- from a class outside of the package

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