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