title: the method is undefined for the type string
body: <p>why would I have "the method is undefined for the type string" in java with this statement:</p>
  
  <pre><code>if(book.getTitle().getAuthor().getAward()){..}
  </code></pre>
  
  <p>the error is for getAward()</p>
  
  <p>when I have defined a class Author as this:</p>
  
  <pre><code>class Author {
  
  private String name;
  private boolean award;
  public Author(String n, boolean p){
      name=n;
      award=p;
  }
  
  public String getName(){return name;}
  public boolean getAward(){return award;}
  </code></pre>
  
  <p>}
  May the error come from another definition (other than Author?)</p>