Variable accessible inside a class but becomes read-only outside the class?

In reply to Reuben:

The way to do this it to write class accessors methods.

See Using Accessors and Mutators in Java