源代码如下:
public class Test {
public static void main(String[] args){
Son s=new Son();
s.show();
}
}
public class Father{
public int age=50;
}
public class Son extends Father{
public int age=19;
public void show(){
int age=39;
System.out.println(age);
System.out.println(this.age);
System.out.println(super.age);
}
}
问题如下:
Father.java is not on the classpath of project java源代码字节码文件夹_4af54545, only syntax errors are reported
Son.java is not on the classpath of project java源代码字节码文件夹_4af54545, only syntax errors are reported
Test.java is not on the classpath of project java源代码字节码文件夹_4af54545, only syntax errors are reported
请问如何解决?
java文件不在当前文件夹的路径下,这是为啥?
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
4条回答 默认 最新
- hfhua 2022-03-11 14:56关注
如果你是用cmd运行的,那要先进去.java文件的上一级目录
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥100 set_link_state
- ¥15 虚幻5 UE美术毛发渲染
- ¥15 CVRP 图论 物流运输优化
- ¥15 Tableau online 嵌入ppt失败
- ¥100 支付宝网页转账系统不识别账号
- ¥15 基于单片机的靶位控制系统
- ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
- ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
- ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
- ¥15 手机接入宽带网线,如何释放宽带全部速度