This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

private protected??  RSS feed

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is this private protected modifier?is it same as default modifier?
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Sandya Bhaskara:
what is this private protected modifier?is it same as default modifier?



private and protected are two different accessibility modifiers. private and protected are similar in that they apply only to members. private means that the member is not accessible from any other class -- even subclasses (nested classes can access private members in their top-level class). it is usually applied to fields and helper methods for classes. protected is not as restrictive, as it allows for access by classes that are either in the same package, or subclasses of that class.

c
[ August 23, 2004: Message edited by: Chris Wash ]
 
Sandya Bhaskara
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops.... i was sure that there was no "private protected" modifier... actually this was the question asked in a mock test..what is private protected modifier?..and some options were given ..i got doubt if there was a "private protected" modifier which i didn't know of...anyway the answer was none of the above...
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
there is a "private protected" modifier but it is not supported in the current java version. 1.2

it allows access only to the subclasses in the same package.
 
All of life is a contant education - Eleanor Roosevelt. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!