Programming, website development forum Get latest updates by RSS Follow TechnicalTalk on Twitter Follow TechnicalTalk on Facebook 
HomeSearchRecent PostsLoginRegisterContact Us

Username  
Password    
  Forgot your password?  

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

significance of public, private and protected

 
webmaster forum
vijay12  Offline
Activity
0%
 
Regular Coder
Posts: 67
Topics: 33
January 08, 2009, 11:37:17 PM

hi...friends, can someone State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers ?? thank you !!!
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
January 09, 2009, 06:28:55 AM

Briefly:

public - can be "seen" by any class in any package
private - can only be "seen" by the class which contains it
protected - can only be "seen" by sub (or super) classes or the class containing it. (and subclasses in other packages)

By default, its sort of public, but only visible in that specific package

« Last Edit: January 09, 2009, 06:30:39 AM by polas »

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.15 | SMF © 2011, Simple Machines


Google visited last this page January 17, 2012, 06:59:23 AM