Skip to content

Commit 66c987f

Browse files
authored
Update Collection_List_Comparable.java
1 parent f9097e3 commit 66c987f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Java Programs/Collection_List_Comparable/Collection_List_Comparable.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public int compareTo(Student s){
3939

4040
}
4141

42-
class Collection_Comparable {
42+
class Collection_List_Comparable {
4343
public static void main(String args[]){
4444

4545

@@ -69,8 +69,8 @@ public static void main(String args[]){
6969
System.out.println("id: "+ s.id + ", name: "+ s.name);
7070
}
7171

72-
Collections.sort(list);
73-
72+
Collections.sort(list); //calling compareTo() function
73+
7474
System.out.println("\nAfter sort: ");
7575
for(Student s : list){
7676
System.out.println("id: "+ s.id + ", name: "+ s.name);

0 commit comments

Comments
 (0)