[3545] in java-interest

home help back first fref pref prev next nref lref last post

Re: protected is not? (longish)

daemon@ATHENA.MIT.EDU (Aleph One)
Wed Nov 15 21:54:43 1995

Date: Wed, 15 Nov 1995 16:22:05 -0600 (CST)
From: Aleph One <aleph1@dfw.net>
To: "D'Arcy Smith" <darcy@arcs.bcit.bc.ca>
Cc: java-interest@java.sun.com
In-Reply-To: <30AA5795.4974@arcs.bcit.bc.ca>

I compleatly agree with your comments. If one of the members of the Java 
team care to comments. Is this necesary or are we missing a point and 
there already is a way to acomplish this in Java?

Aleph One / aleph1@dfw.net
http://underground.org/
KeyID 1024/948FD6B5 
Fingerprint EE C9 E8 AA CB AF 09 61  8C 39 EA 47 A8 6A B8 01 

On Wed, 15 Nov 1995, D'Arcy Smith wrote:

> Introduce a new keyword?
> 
> How about this:
>  
> (current java)
> public    - world access
> private   - class access
> protected - package access
> 
> (new java?)
> public    - world access
> private   - class access
> protected - class/subclass access (like C++)
> shared    - package access
> 
> thus the above becomes:
> 
> 
> class Base
> {
>    protected int x;
>    shared    int y;
> }
> 
> 
> class Derived
> {
>    public void f()
>    {
>       x = 1;
>       y = 2;
>    }
> }
> 
> 
> class OtherClass
> {
>    public void g()
>    {
>       Base b = new Base();
> 
>       b.x = 1;   // good I can't access Base::x here :-)
>       b.y = 2;   // good I can access Base::y here :-)
>    }   
> }
> 
> This also has the effect of getting rid of the implicit friending
> of all package related classes.  (I like that :-))
> So now a class can say what it's friends are allowed to see and not
> be exposed to the world =:-0.
> 
> comments?
> 
> ..darcy
> 
> -- 
>    D'Arcy Smith, Systems Analyst
>    Applied Research in Computer Systems (ARCS) Laboratory
>    British Columbia Institute of Technology (BCIT), Burnaby, BC, Canada
>    E-Mail: darcy@arcs.bcit.bc.ca        URL http://www.arcs.bcit.bc.ca
>    Tel:  (604) 432-8281      		Fax:  (604) 436-1297
> 
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post