title: Why is import of class not needed when calling method on instance (Java)
body: <p>Something that's confused me - an example:</p>
  
  <p>Thing.java:</p>
  
  <pre><code>import java.util.Date; 
  
  class Thing { 
      static Date getDate() {return new Date();}
  }
  </code></pre>
  
  <p>(same package) TestUsesThing.java:</p>
  
  <pre><code>// not importing Date here.
  
  public class TestUsesThing {
  
      public static void main(String[] args) {
          System.out.println(Thing.getDate().getTime()); // okay
          // Date date = new Date(); // naturally this wouldn't be okay
      }
  
  }
  </code></pre>
  
  <p>Why is it not necessary to import Date to be able to call getTime() on one of them?</p>