should protected imply package?

Jeremie Pelletier jeremiep at gmail.com
Thu Sep 24 10:55:53 PDT 2009


Andrei Alexandrescu wrote:
> In Java, "protected"-level protection implies package-level protection 
> (see e.g. 
> http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html). 
> Should we copy that behavior in D, or take advantage of the package 
> keyword and require it as in "package protected"?
> 
> 
> Andrei

I make a clear distinction between 'protected' which can be accessed by 
any subclasses no matter their modules or packages, and 'package' which 
is like public but for the current package only.

Jeremie



More information about the Digitalmars-d mailing list