This commit is contained in:
ldy
2026-03-01 23:18:55 -05:00
commit 67f753a5d1
3087 changed files with 218259 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
public abstract class Course {
//the Course class should be abstract as it contains abstract method
//instance variables
private String code;
private String title;
private Course preRequisite;
//constructor
public Course(String code, String title, Course preRequisite) {
if(preRequisite != null) {
this.code = code;
this.title = title;
this.preRequisite = preRequisite;
}
else {
System.out.println("pre-requisite course cannot null!");
return;
}
}
//methods
public String getCode() {return this.code;}
public String getTitle() {return this.title;}
public Course getPreRequisite() {return this.preRequisite;}
//isRequired() should be abstract as the course are undefined
public abstract boolean isRequired();
//test
public static void testCourse() {
// Since we cannot create any Course object, the testCourse method of the Course class must be empty.
}
}

View File

@@ -0,0 +1,6 @@
public class Start {
public static void main(String[] args) {
Course.testCourse();
}
}