Challenge for Programming with the Java Collection Framework

Challenge

Fill in compareTo in the Date class below so that it successfully implements the interface Comparable<Date>. The ordering on objects of type Date should be the natural, chronological ordering.

The boilerplate code will scan in the input to create Dates, and then sort them based on your compareTo implementation, and print them based on the included toString method.

Please sign in or sign up to submit answers.

Alternatively, you can try out Learneroo before signing up.

Contact Us
Sign in or email us at [email protected]