How can we have a variable that is writable within the class but only \"readable\" outside it?
For example, instead of having to do this:
Class
Actually the HotSpot compiler would most likely inline calls to your getters, so no overhead will be involved (besides, the overhead for calling these methods would hardly be measurable).
EDIT
If you really need every CPU cycle, use C or C++ (or write performance-critical parts in it and call it via JNA, though its unlikely that it will be worth the time spent).