• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

access modifier??

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1)If no accessibility modifier (public, protected and private) is given in a member declaration of a class, the member is only accessible for classes in the same package and subclasses of the class

here is it false because of the condition of satisfying both (i.e same package and any subclass)..


simple doubt ...

thanks

sri
 
Ranch Hand
Posts: 657
Spring VI Editor Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

here is it false because of the condition of satisfying both (i.e same package and any subclass)..


Correct.
 
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think question is ambigous :

1)If no accessibility modifier (public, protected and private) is given in a member declaration of a class, the member is only accessible for (classes in the same package) and (subclasses of the class)
-> true

1)If no accessibility modifier (public, protected and private) is given in a member declaration of a class, the member is only accessible for classes (in the same package and subclasses of the class)
-> false
 
Steve Morrow
Ranch Hand
Posts: 657
Spring VI Editor Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

1)If no accessibility modifier (public, protected and private) is given in a member declaration of a class, the member is only accessible for (classes in the same package) and (subclasses of the class)
-> true


That's false, unless there's some definition of *and* I'm not considering. It can't be *and*, because the set of subclasses includes those that are not within the package, which of course do not have access to default members of their supertypes. Can you describe further what you found ambiguous?
 
reply
    Bookmark Topic Watch Topic
  • New Topic