added ex V

This commit is contained in:
2025-01-07 14:44:35 +01:00
parent 1cfc40afed
commit e959cdd466
4 changed files with 104 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
package exercises.ex_v;
public class Result implements Comparable<Result>{
private final int time;
private final String team;
public Result(String team, int time) {
this.time = time;
this.team = team;
}
public int getTime() {
return time;
}
public String getTeam() {
return team;
}
@Override
public int compareTo(Result result) {
return this.getTime() - result.getTime();
}
@Override
public String toString() {
return getTeam() + " : " + getTime() + "h";
}
}