Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

access modifier??

 
srikanth reddy
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • 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
 
Steve Morrow
Ranch Hand
Posts: 657
Clojure Spring VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is it false because of the condition of satisfying both (i.e same package and any subclass)..

Correct.
 
Seb Mathe
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • 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
Clojure Spring VI Editor
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic