title: Error while executing groovy script
body: <p>Code is a follows:</p>
  
  <pre><code>class Book
  {
       private String title
       Book (String theTitle)
       {
           title=theTitle
       }
       String getTitle()
       {
           return title
       }
  }
  Book gina=new Book('Groovy in Action')
  assert gina.getTitle()=='Groovy in Action'
  assert getTitleBackwards(gina)=='noitcA ni yvoorG'
  String getTitleBackwards(Book)
  {
      title=book.getTitle()
      return title.reverse()
  }
  </code></pre>
  
  <p>When I execute is with Ctrl+R, I get the following compilation error.</p>
  
  <p>1 compilation error:</p>
  
  <blockquote>
    <p>Invalid duplicate class definition of class Book : The source
    Book.groovy contains at least two definitions of the class Book. One
    of the classes is an explicit generated class using the class
    statement, the other is a class generated from the script body based
    on the file name. Solutions are to change the file name or to change
    the class name.  at line: 1, column: 1</p>
  </blockquote>
  
  <p>Can anybody please explain me what is happening here.</p>