Page 2 of 2

Re: other class cant change variables in another class.

Posted: Sun Jan 25, 2009 1:51 pm
by programmerinprogress
Yeah it's much better practice to restrict immediate access to your variables, accessor methods help prevent unwanted mistakes bugs and errors (or deliberate hacks from users of your class).

Re: other class cant change variables in another class.

Posted: Sun Jan 25, 2009 5:59 pm
by eatcomics
LeonBlade wrote:Yeah he is...

If you want to change variables, use a Public Get/Set
Good to know I'm doing things right :mrgreen: