"counter.java": Error #: 901 : package . stated in source C:\Documents and Settings\Administrator\jbproject\untitled3\src\untitled3\counter.java does not match directory untitled3

解决方案 »

  1.   

    你应该把它放在C:\Documents and Settings\Administrator\jbproject\untitled3\src\counter.java 
    下,
    或者给代码加个包!
    package untitled3;
      

  2.   

    "counter.java": Error #: 308 : non-static method ReadFile(java.lang.String) cannot be referenced from a static context at line 11, column 7
      

  3.   

    你在哪里出错?
    在哪里调用的ReadFile(java.lang.String)?
      

  4.   

    是这样的我在代码中加入
            public static void main(String args[]) throws FileNotFoundException{       String cont="0";
    cont=ReadFile("/count.txt");
             WriteFile("count.txt",cont);        }
    则编译报错
      

  5.   

    问一下,是用JBUILD6编写的吗?
      

  6.   

    没什么区别! 你的程序里path and filepath的值是一样的.同时, 因为你在main()中调用readfile() and writefile() , but the main() method is staitc , so u must write the methods readfile() and writefile() to staitc. exp:
    public static String readfile(...)
    {...}public static void writefile(...)
    {...}