Skip to content

Commit 2ae9130

Browse files
committed
CompareTo Method
1 parent dd1a574 commit 2ae9130

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

Binary file not shown.

src/top/ligongd/collections/compareto/SortDemos.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ public static void main(String[] args) {
1919
personList.add(person1);
2020
personList.add(person2);
2121
personList.add(person3);
22+
23+
for(Person person: personList){
24+
System.out.println(person.getName() + " " + person.getAge());
25+
}
26+
2227
Collections.sort(personList);
2328

2429
for(Person person: personList){

0 commit comments

Comments
 (0)