
public int compareTo(Object Student) throws ClassCastException {
if (!(Student instanceof StudentMarks))
throw new ClassCastException("Not a Student!");
int mark = ((StudentMarks) Student).getMarks();
return this.marks - mark;
Hi,can I know what is the meaning for the above coding?I have find the explanation in internet,but not very clear about it. Thank you.