title: Groovy property definition
body: <p>Previously I'd thought that a property in Groovy is indicated by the omission of a scoping keyword. In other words</p>
  
  <pre><code>class Test {
     def prop = "i am a property"
     public notProp = "i am not"
  }
  </code></pre>
  
  <p>However, it appears I'm incorrect about this, because the following script prints "getter val"</p>
  
  <pre><code>class Foo {
    public bar = "init val"
  
    public getBar() {
      "getter val"
    }
  }
  
  println new Foo().bar
  </code></pre>
  
  <p>The fact that the getter is invoked when <code>bar</code> is accessed suggests that <code>bar</code> is a property rather than a field. So what exactly is the difference between fields and properties in Groovy.</p>
  
  <p>Thanks,
  Don</p>