Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!