View Single Post
  #3 (permalink)  
Old 07-28-2007, 05:11 PM
cruxblack cruxblack is offline
Senior Member
 
Join Date: Jul 2007
Posts: 130
cruxblack will become famous soon enough
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

Last edited by cruxblack : 07-28-2007 at 05:15 PM.
Reply With Quote