我是 Java 新手。
我所有的源文件(例如 TreeJPanel.java、Tree.java)都在一个名为 jview 的目录中,它们之间存在依赖关系。当我尝试编译时
javac jview/TreeJPanel.java
我明白了:
jview/TreeJPanel.java:39: cannot find symbol
symbol : class Tree
location: class TreeJPanel
protected Tree tree;
^
jview/TreeJPanel.java:41: cannot find symbol
symbol : class Tree
location: class TreeJPanel
public Tree getTree() {
^
jview/TreeJPanel.java:45: cannot find symbol
symbol : class Tree
location: class TreeJPanel
public void setTree(Tree tree) {
有 15 个类似的错误。我以为我不需要从同一目录中显式导入?我究竟做错了什么?我的问题很可能表明缺乏对 Java 的概念理解——请随时指出。谢谢!