other class cant change variables in another class.
Moderator: Coders of Rage
- programmerinprogress
- Chaos Rift Devotee
- Posts: 632
- Joined: Wed Oct 29, 2008 7:31 am
- Current Project: some crazy stuff, i'll tell soon :-)
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++!
- Location: The UK
- Contact:
Re: other class cant change variables in another class.
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).
---------------------------------------------------------------------------------------
I think I can program pretty well, it's my compiler that needs convincing!
---------------------------------------------------------------------------------------
And now a joke to lighten to mood :D
I wander what programming language anakin skywalker used to program C3-PO's AI back on tatooine? my guess is Jawa :P
I think I can program pretty well, it's my compiler that needs convincing!
---------------------------------------------------------------------------------------
And now a joke to lighten to mood :D
I wander what programming language anakin skywalker used to program C3-PO's AI back on tatooine? my guess is Jawa :P
Re: other class cant change variables in another class.
Good to know I'm doing things rightLeonBlade wrote:Yeah he is...
If you want to change variables, use a Public Get/Set