import java.util.*;
class MyComp<Subject> implements Comparator<Subject> {
public int compare(Subject s1, Subject s2) {
return s1.year - s2.year;
}
}
public class Subject {
String subjectID;
int sem;
String dept;
public int year;
String subjectName;
int theortical;
int practical;
int tutorial;
}
我在编译cannot find symbol s1.year
时遇到问题。 s2.year
也是如此。