We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6d327f commit b10dd12Copy full SHA for b10dd12
1 file changed
Algorithms/ComparableExample.java
@@ -0,0 +1,13 @@
1
+
2
+class Person implements Comparable<Person>{
3
+ int start,end,c;
4
+ public Person(int start,int end,int c){
5
+ this.start=start;
6
+ this.end=end;
7
+ this.c=c;
8
+ }
9
10
+ public int compareTo(Person p){
11
+ return this.start - p.start;
12
13
+}
0 commit comments