class Course{
private String courseID = "";
private String courseName = "";
private String credit = "";
public Course(){
}
public Course(String courseID){
this.courseID = courseID;
}
public Course(String courseID,String courseName){
this(courseName);
this.courseID = courseID;
}
public Course(String courseID,String courseName,int credit){
this.courseID = courseID;
this.courseName = courseName;
this.credit = credit;
}
}
public class CourseTest {
public static void main(String args[]){
Course ol=new Course();
Course o2=new Course("0537331165");
Course o3=new Course("0537331165","JAVA");
Course o4=new Course("0537331165","JAVA",4);
System.out.println(ol.Course());
System.out.println(o2.Course("0537331165"));
System.out.println(o3.Course("0537331165","JAVA"));
System.out.println(o4.Course("0537331165","JAVA",4));
}
}
————————————————————————————————————
这个程序麻烦帮我看看错误出在哪可以吗?
我编译提示
this.credit = credit;
System.out.println(ol.Course());
System.out.println(o2.Course("0537331165"));
System.out.println(o3.Course("0537331165","JAVA"));
System.out.println(o4.Course("0537331165","JAVA",4));
这5处地方出错~~~~~可总不知道问题错在哪