Access modifier
- private = available only inside it's own class
-
default (no modifier) = available inside it's own class and subclasses residing in the same directory only
- protected = available inside it's own class and subclasses anywhere
- public = available publically, no limitation
Foo methods that are accessible to the Bar class are
a aren't accessible, since it's access modifier are
default n bar located in another directory
b are accessible
c aren't accesible, its private
d aren't accesible, synchronized aren't an access modifier, its used for thread synchronization, the access modifier for the method are
default
e aren't available, having a
default modifier
I hope this isn't some kinda homework
But if i were supposed to pick one, i'll pick the one with the less limitation, choice 2 ==> b
Hope this helps
