title: Java method().method() calling
body: <p>How, if it's possible, can you call a <code>method</code> from another method's <code>return</code>?</p>
  
  <p>For example...</p>
  
  <pre><code>class Example {
      public static void main(String[] args) {
          Point t1 = new Point(0,0);
          Point t2 = new Point(0,1);
          ArrayList pointContainer = new ArrayList();
          pointContainer.add(0,t1);
          pointContainer.add(0,t2);    // We now have an ArrayList containing t1 &amp; t2
          System.out.println(pointContainer.get(1).getLocation()); // The problem area
      }
  }
  </code></pre>
  
  <p>In the poorly written example, I'm trying to invoke the <code>getLocation()</code> method (part of <code>java.swing.awt</code>) on index item 1 of <code>pointContainer</code>.</p>
  
  <p>When trying to compile the program, I get the following error...</p>
  
  <pre><code>HW.java:20: error: cannot find symbol
          System.out.println(test.get(1).getLocation());
                                    ^
    symbol:   method getLocation()
    location: class Object
  </code></pre>
  
  <p>Could someone please help me with this problem.</p>