请问这是什么错误.......

21stboy 21stboy 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
请问这是什么错误(我在用java Inheritance.class命令时,Inheritance.java用jbuilder3编译通过)
下面是错误提示:

exception in thread "main" java.lang.NoClassDefFoundError:Inheritance/class

下面是程序源码
//Title: 类继承
//Version:
//Copyright: Copyright (c) 1999
//Author: 21stboy
//Company: pengesoft co. ltd.
//Description:类继承

class A{
int a=1;
public int b=2;
protected int c=3;
private int d=5;
int geta()
{
return d;
}
}

class B extends A{
int f=6;
}

public class Inheritance {
//Main method
public static void main(String[] args) {
A aa=new A();
System.out.println("a="+aa.b);
}
}
...全文
评论 13
收藏 已收藏
分享
返回顶部
21stboy
Java SE 62,621 成员 307,251 内容