title: Unable to access a class from the same package
body: <p>I have 2 classes in java</p>
  
  <pre><code>//file: A.java
  package files;
  
  public class A {
     B b;
  }
  </code></pre>
  
  <p>the next file</p>
  
  <pre><code>//file: B.java
  package files;
  
  public class B {}
  </code></pre>
  
  <p>Now when I compile A.java using</p>
  
  <pre><code>javac A.java
  </code></pre>
  
  <p>I get the error</p>
  
  <pre><code>unable to resolve symbol B
  </code></pre>
  
  <p>Although, if I don't mention the package line, it works fine.</p>
  
  <p>What am I doing wrong ?</p>