posted 22 years ago
You need to check out access modifiers. For example, "protected" allows a field to be accessed by another class in the same package or a subclass.
The other way, which I prefer most of the time, is to keep the class fields "private" and then create "public" methods to get and set the field values, e.g. getters and setters.
For example:
As far as access modifiers go, "public" means that any class can access them.
Blake Minghelli<br />SCWCD<br /> <br />"I'd put a quote here but I'm a non-conformist"