并且对编译过程有点困惑:
这是我的文件结构
bin/test/A.java test/B.java
# B.java
package test;
private class B{
public static void say(){
System.out.println("Hello.");
};
}
# A.java
package test;
public class A{
public static void main(String arg[]){
test.B.say();
}
}
然后我编译 A.java
javac -cp test/*.java test/A.java
它给了我错误:
test/A.java:4: cannot find symbol
symbol : class B
location: package test
test.B.say();
^
1 error