Default Access Flashcards

1
Q

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

A

A default method (package-private) is a method that can only be accessed from within the same package.

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

Remind me of the definition of a default access method !

A
  • All the possible ways a default 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