Classes:
--------
Modifiers allowed: public or default ( or static)
1. public - the name of the class should be the same as the file name and
the class can be accessed from any package.
2. default - there can be several classes in the same file and has only
package vissibility
3. static - allowed only for inner classes


Methods and Variables:
---------------------
Modifiers Allowed: public, protected, private or default
1. public - allows access across all packages
2. protected - allows access to all sub-classes (whether in the same package
or other packages)
3. private - allows access with the class only.
4. default - allows access within the same package only.


Hope this helps...
Rgds



-----Original Message-----
From: Amit Bansal [mailto:[EMAIL PROTECTED]]
Sent: 04 December 2000 11:15
To: [EMAIL PROTECTED]
Subject: Core concepts


Hi all,
          I have a doubt in the java access modifiers.
What is the difference between protected and default modfiers.
Make it clear to me.
looking for expert' comments

Rgds
Amit

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".


********************************************************************
This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorised to
retain, read, copy or disseminate this message or any part of it.
********************************************************************

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to