java运行出错!!

来源:百度知道 编辑:UC知道 时间:2024/05/06 04:11:11
class StudNode{
String name;
int studentNo;
double score;
StudNode next;
public StudNode(){}
public StudNode(String name,int studentNo,double score){
this.name=name;
this.studentNo=studentNo;
this.score=score;
}
public void setName(String name){
this.name=name;
}
public void setStudentNo(int studentNo){
this.studentNo=studentNo;
}
public void setScore(double score){
this.score=score;
}
public void setNext(StudNode node){
this.next=node;
}
public String getName(){
return name;
}
public int getStudentNo(){
return studentNo;
}
public double getScore(){
return score;
}
public StudNode getNext(){
return next;
}
public String toString(){
return studentNo+","+name+","+score;
}
}
interface StudOPeration{
void add(StudNode n

你只是定义了一个类和它的一些属性方法等等,根本没有调用、实例化,程序都没有入口,如何执行?你先百度一下main()这个函数的功能,以及相关的知识,就会知道你的问题在哪里了!

你运行啥了? 你的代码根本没有可运行的部分。

老大,你的问题能不能详细些,究竟要干什么。程序编译没错阿。补充一下吧,不然没人能帮你。