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
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