My interpretation of the sorting criteria:
public int compareTo(Object otherDVD){
if(!(otherDVD instanceof DVD)){
throw new ClassCastException("Invalid object");
}
int oyearOfRelease = ((DVD)otherDVD).yearOfRelease;
if(this.yearOfRelease() > oyearOfRelease)
return 1;
else if ( this.yearOfRelease() < oyearOfRelease )
return -1;
else
return this.movieTitle.compareTo(((DVD)otherDVD).movieTitle);
}
Cheers