OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
but not through object reference
OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Harikrishna Gorrepati wrote:Static variables can be accessed in subclass through inheritance and object reference. instance variables can be accessed through inheritence only but not through object references.
OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Harikrishna Gorrepati wrote:Hi,
Subclass will inherit super class instance variable through inheritence but not through object reference. But subclass can inherit super class static variable through inheritence or object reference. Please let me know if I am wrong. But is Kathy Sierra book, author gave generic statement about the variables.
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Harikrishna Gorrepati wrote:Hi Venkatsamy, I am not confused. What I mean to ask is, Protected = package level + subclasses in different packages for IS-A relationship.
Harikrishna Gorrepati wrote:
If subclass has HAS-A relationship to Super class only static variables/methods are visible and instance variables/methods are NOT visible..Is that correct ?
OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |