Programming and Webmasters forum
HomeSearchRecent PostsLoginRegister Contact Us

Username  
Password
Announcing 14th Weekly Contest - From 25 July To 01 August.

Win every week on this forum.

Chek out How To Win?
 

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
Contest Points: 100
 
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
*
 
Hacker
Gender: Male
Posts: 1224
Topics: 78
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
Skydive in North East England
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC


Google visited last this page July 14, 2010, 06:09:18 PM

Valid XHTML 1.0 Transitional     Valid XHTML 1.0 Transitional