• 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

Default access

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Anyone pl. explain the meaning of the foll. statement.
Fellow package members should get accessed , not granted
to classes outside the package.
Thanks!
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

not sure what you don't understand in that stmt....
to me it looks like one of the ways you can describe
the default/friendly/package access modifier.
default access means access in the same package and
no access to classes outside the package.
or Am I missing something ?
regds.
- satya
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am sorry for not being clear .Actually the statement
is regarding default class given in RHE.I couldnt get
what it meant.It meant that the other package members
must also get access to other package classes.But,
My doubt is REGARDING the grant word.what does it mean???
what is the difference between access and grant?If
access is given for the classes to access other package
members ,is not equivalent to granting the class???
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

IMO, it is.
regds
- satya
 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
avn,
From RHE as you quoted,
Fellow package members should get accessed , not granted
to classes outside the package.

This means, the accessiblity of the class which has 'package'/default level access is given to the fellow package members and NOT GRANTED to outsiders. (members of other packages). Here the word 'GRANT' serves a suitable meaning. When we do something out of our wish we say , 'we grant so and so to .. so and so person', Isn't? That means the 'giving away' is not a default action. Which also means we should not take for granted that the action will happen. Simillarly here the fellow package members are GIVEN access and other package members are not given or NOT GRANTED access. The GRANTED stresses the point that the other package members are treated as outsiders and so we grand/don't grand permission to access.
Simillarly take the other access type 'protected'. Here we can say the fellow package members are GIVEN (not granted , because the fellow members are in the SAME CIRCLE as that of the 'protected' class) permission to access the class which has 'protected' access / the subclasses of this 'protected' class are GRANTED permission whereas all other classes except the subclasses in other packages are NOT GRANTED PERMISSION to access the 'protected' type class. Does this make sense avn ?.
regds
maha anna
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks! maha. Its clear now.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic