title: Cannot access method in other project of java
body: <p>I have create one java project which has following class with it's body.</p>
  
  <pre><code>package tfimvalidation;
  
  public class ValidateToken {
      public void display()
      {
          System.out.println("Yor package imprort succesfully");
      }
  }
  </code></pre>
  
  <p>This is java project now I have create jar file of this project and add it in other my dynamic web project.</p>
  
  <p>There is I can access ValidateToken class and package with following statement</p>
  
  <pre><code>ValidateToken validateToken = new ValidateToken();
  </code></pre>
  
  <p>but I cannot access validateToken.display();</p>
  
  <p>it's give this type of error;
  Syntax error on token "display", Identifier expected after this token.</p>
  
  <p>This is code of second project where I have use jar of first project.
      import tfimvalidation.ValidateToken;</p>
  
  <pre><code>public class Main
  {
       ValidateToken validateToken=new ValidateToken();
      validateToken.display(); //Here gives above shown error.
  }   
  </code></pre>