Damilola Okuboyejo wrote:d@
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Avishkar Nikale wrote:There is an example on page 35 in SCJP Study Guide by Kathy & Bert which can help you understand this.
Rob Prime wrote:
Damilola Okuboyejo wrote:d@
Please UseRealWords. It took me a minute to figure out you meant "that".
I'll have a counter example that does show the difference between protected and default access:
Protected members can only be accessed on instances of the sub class, not on instances of the super class. Because I changed the reference type (and actual type) it started working.
Regards,
Avishkar Nikale
Don't walk as if you rule the world, walk as if you don't care who rules it...
Ninad Kuchekar wrote: Below is a link in which you will find a mapping table for all the access modifiers, it might clear your doubt.
Don't walk as if you rule the world, walk as if you don't care who rules it...
Damilola Okuboyejo wrote:
Rob Prime wrote:
Damilola Okuboyejo wrote:d@
Please UseRealWords. It took me a minute to figure out you meant "that".
thanks Rob
and sorry about the short-code ''d@''
got d clarification.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:
Damilola Okuboyejo wrote:
Rob Prime wrote:
Damilola Okuboyejo wrote:d@
Please UseRealWords. It took me a minute to figure out you meant "that".
thanks Rob
and sorry about the short-code ''d@''
got d clarification.
What makes you think that, if "d@" isn't accepted as a replacement for "that", that "d" would be acceptable as replacement for "the"? You haven't even read the UseRealWords page, have you?
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:As far as I know, it has always worked like this. protected constructors can really only be called as a chained constructor from sub class constructors. protected members can only be accessed by a sub class if they are its own members, like inside other methods of the sub class or if the reference type is the sub class itself.
Regards,
Avishkar Nikale
SCJP6.0,My blog Ranchers from Delhi
Avishkar Nikale wrote:
Rob Prime wrote:As far as I know, it has always worked like this. protected constructors can really only be called as a chained constructor from sub class constructors. protected members can only be accessed by a sub class if they are its own members, like inside other methods of the sub class or if the reference type is the sub class itself.
Rob,
Should the example provided by Damilola failed in all cases of JDK versions.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Regards,
Avishkar Nikale
Please enjoy this holographic presentation of our apocalyptic dilemma right after this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|