[240] in java-interest
Re: Just to make "private" painfully clear.
daemon@ATHENA.MIT.EDU (Arthur van Hoff)
Thu Jun 8 15:04:13 1995
Date: Thu, 8 Jun 1995 11:54:48 -0700
From: Arthur.Vanhoff@Eng.Sun.COM (Arthur van Hoff)
To: clp@home.HarvardSq.com
Cc: java-interest@java.Eng.Sun.COM
Hi Charles,
> Finally, about private methods and variables:
>
> (1) I don't see why separating accessibility from visibility is such
> a great idea (the only thing I could think of was if the accessibility
> of a class' contents changes over time, this allows other classes that
> depend on that content to not become, e.g., (compile-time) ambiguous.
> Is there some other philosophical language reason?
Nope, that's it!
> (2) Arthur, you still didn't answer the pollution question fully. Why
> should a fully PRIVATE variable or method (one that I can't use) cause
> me to have to fully disambiguate my own method or variable of the same
> name? I.e., (a) do I have to do this? (b) why? The above reason only?
Maybe I wasn't clear enough. You DON'T have to disambiguate methods
and variables from private methods and variables. You can't access
methods variables, and they WILL NOT cause ambiguities.
I unintentionally confused the issue by mentioning that the compiler
will warn you if you try to access a private variable or method (ie the
compiler sees it and it will mention that it is there). However, the
compiler will ignore it in all other cases.
Have fun,
Arthur van Hoff (avh@eng.sun.com)
http://java.sun.com/people/avh/
Sun Microsystems Inc, M/S UPAL02-301,
100 Hamilton Avenue, Palo Alto CA 94301, USA
Tel: +1 415 473 7242, Fax: +1 415 473 7104
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com