On Jan 21, 7:03 am, BillyRay <[email protected]> wrote:

> What are the rules or guidelines for deciding when it is appropriate
> to use the getter/setter methods to access instance variables in
> another method inside of a class versus accessing the variables
> directly?
It is always better to access variables with getter and setter
methods. This way, you ensure they cannot be accessed directly. If you
use Netbeans, there is a refactor task which allows you to transform
your code to always do that.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to