File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes protected and package/default access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "protected and package/default access" Watch "protected and package/default access" New topic
Author

protected and package/default access

FELIX ALE
Greenhorn

Joined: Apr 08, 2005
Posts: 2
What is the major difference between protected and package/default access specifiers, someone should help me please.
Ben Wood
Ranch Hand

Joined: Aug 14, 2001
Posts: 342
protected is less restrictive than the default and allows visibility to subclasses outside the package of the superclass. Default only allows access to subclasses within the same package as the superclass.


SCJP 1.4, www.gsi3d.org.uk
Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256
Protected works between packages and default works only in the same package.
this is the simplest explanation I can think of.


Life called,so here I am.<br />Cheers<br />Niki.:-)
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
When I studied Java for the exam, I used a book which called the default accessor "package private". this name really tells a lot... ;-)

greets,
jan.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: protected and package/default access
 
Similar Threads
protected access of a class
access level
Explicit default constructor
default scope
protected member