Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
0
You can sort dates expressed in java.time.LocalDate because it implements the compareTo method. var d1 = LocalDate.of(2010,11,30); var d2 = LocalDate.of(1980,3,1); System.out.println(d1); System.out.println(d2); System.out.print(d2.compareTo(d1)); https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html If this is homework, then at least give it a try before asking for help, and post your code attempt when you are stuck. Don't expect others to do your homework.
19th Sep 2020, 1:18 PM
Tibor Santa
Tibor Santa - avatar