title: Import cannot be resolved in java
body: <p><a href="https://i.stack.imgur.com/3x2QN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3x2QN.png" alt="enter image description here"></a>I am getting: </p>
  
  <pre><code>import com.test.foo.A cannot be resolved 
  </code></pre>
  
  <p>IDE I am using is NWDS.</p>
  
  <p>I have a class A which is declared as public, I have a class B which is declared as public final. Both are declared in different packages.</p>
  
  <p>Class A in com.test.foo </p>
  
  <p>Class B in com.test.foo1</p>
  
  <p>I am trying to import a public method from class A to class B but I am getting the above mentioned error in IDE.</p>
  
  <p>Both are in different projects.</p>
  
  <p>Code snippet as below :-</p>
  
  <pre><code>package com.test.foo 
  
  public class A {
  
      public static void method1(){
      ....some code ....
      }
  
  }
  
  -----
  
  package com.test.foo1
  
  import com.test.foo.A // i'm getting error here as import cannot be resolved
  
  public final class B {
  
      private method2(){
  
      ...... some code....
       A.method1(); // import cannot be resolved error
      }
  }
  </code></pre>
  
  <p>Can any help help on this?</p>
  
  <p>Thanks in advance for you help :)</p>