| Author |
protected access modifier
|
devika cha
Greenhorn
Joined: Dec 17, 2003
Posts: 23
|
|
A protected instance variable can be accessed by subclass in same package or from different package by inheritance. My question is how to access protected instance var in the subclass that is in same package . thank you. [ edited to preserve formatting using the [code] and [/code] UBB tags and to format the code -ds ] [ January 09, 2004: Message edited by: Dirk Schreckmann ]
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26201
|
|
Sulakshana, You have the right idea. In the example you posted, the dep class is not a sublcass of the Test class. It is extending a class called ThreadTest. [ January 08, 2004: Message edited by: Jeanne Boyarsky ]
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Mr. C Lamont Gilbert
Ranch Hand
Joined: Oct 05, 2001
Posts: 1170
|
|
|
protect from what?
|
 |
 |
|
|
subject: protected access modifier
|
|
|