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
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???
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