# Newbie question

**URL:** <https://forum.kirupa.com/t/newbie-question/292232>\
**Category:** Uncategorized\
**Created:** [July 12, 2009, 2:22am UTC](https://forum.kirupa.com/t/newbie-question/292232 "2009-07-12T02:22:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TCAtect](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@TCAtect](https://forum.kirupa.com/u/TCAtect)\
**Post date:** [July 12, 2009, 2:22am UTC](https://forum.kirupa.com/t/newbie-question/292232/1 "2009-07-12T02:22:04Z")

</div>

Some background info: I’ve been freestyling ActionScript 3 for a while now, and recently decided to pick up a book and learn OOP/Classes like a pro. However, since I’ve always worked out logic as I coded, there are a few concepts in early chapters that I’m not fully grasping.

I’ll start with a simple one:

In examples, variables seemed to be declared private all the time. For example, we have a class position, and **xCoord, yCoord are declared privately**. To access them we use the public methods getX() and getY(). To me, it seems to be much more intuitive just having **xCoord and yCoord declared publicly** and accessing them directly. Perhaps I’m missing the bigger picture? Is there a telling example when indeed, **it’s far more advantageous to use methods to get values of private variables rather than declaring the variables publicly in the first place**?

Thanks guys. I hope to be enlightened soon.
