This week's book giveaway is in the Other Open Source APIs forum.
We're giving away four copies of Storm Applied and have Sean Allen, Peter Pathirana & Matthew Jankowski on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes protected access modifier Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Storm Applied this week in the Other Open Source APIs forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "protected access modifier" Watch "protected access modifier" New topic

protected access modifier

Anupam Sinha
Ranch Hand

Joined: Apr 13, 2003
Posts: 1090
Have a look at it

name this file
Create another file in the aas directory now make a file with the following code and name it

Now the problem is that if i make this var xintest1 as static then the line 1 can access it as if it is not protected but public.
[ May 15, 2003: Message edited by: Anupam Sinha ]
Anupam Sinha
Ranch Hand

Joined: Apr 13, 2003
Posts: 1090
Well I thought about it and i guess that this because now that the xintest1 is static it can be accessed by any class instance or simply by class name so its just that I am using it through an instance.
I agree. Here's the link:
subject: protected access modifier