# Simple getter setter question

**URL:** https://forum.kirupa.com/t/simple-getter-setter-question/296593
**Category:** Uncategorized
**Created:** [September 17, 2009, 3:05am UTC](https://forum.kirupa.com/t/simple-getter-setter-question/296593 "2009-09-17T03:05:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cpthk](https://avatars.discourse-cdn.com/v4/letter/c/aca169/32.png) [@cpthk](https://forum.kirupa.com/u/cpthk)
#### Post date: [September 17, 2009, 3:05am UTC](https://forum.kirupa.com/t/simple-getter-setter-question/296593/1 "2009-09-17T03:05:53Z")

</div>

```auto

public var _testvar:Boolean = false;
          
          public function set testvar(value:Boolean):void{
              _testvar = value;
          }
          
          private function get testvar():Boolean{
              return _testvar
          }

```

I don’t understand why if my variable name is testvar not \_testvar, it won’t compile. Actionscript really require that underscore symbol at the front. What’s the reason they design this way, why not just no underscore all the way. What’s the benefit of enforce that underscore?

Thanks.
