title: Java using a method public int instead of public static int
body: <p>I want to use "<strong>public int CountWord</strong>" instead of "<strong>public static int CountWord</strong>", below code its give me error that, <em>Cannot make a static reference to the non-static method CountWord(String, String) from the type CountWord</em> , why i am getting this error and how can i use it without using static keyword. 
  Thanks</p>
  
  <pre><code>public static void main(String[] args) {
      System.out.println(CountWord("the","test.txt"));
  }
  
  public int CountWord(String word, String textFilePath){
  
  }
  </code></pre>