This is the mail archive of the
java-discuss@sources.redhat.com
mailing list for the Java project.
Re: Should added members be proteced or private?
- To: Jeff Sparkes <Jeff_Sparkes at excite dot com>
- Subject: Re: Should added members be proteced or private?
- From: Tom Tromey <tromey at cygnus dot com>
- Date: Fri, 28 Jul 2000 22:18:51 -0700 (PDT)
- Cc: java-discuss at sources dot redhat dot com
- References: <7056752.964824766420.JavaMail.imail@neon.excite.com>
Jeff> Should I keep everything that is not in the API spec as private,
Jeff> or can I used friendly/default or protected as necessary? I
Jeff> assume I should not add anything public to the class.
I personally always use "private". I find that more clear. I only
use the default protection in those cases where I definitely need
access from some other class in the package.
Definitely do not add new public or protected fields or methods.
If the class is serializable you might also consider making sure your
implementation conforms to the serialization spec.
Tom