0
What is the difference between the 0, 1 and -1 returns of compareTo() in Java?
Example:
Date date1 = '08/02/2019';
Date date2 = '08/03/2019';
date1.compareTo(date2);
0
What is the difference between the 0, 1 and -1 returns of compareTo() in Java?
Example:
Date date1 = '08/02/2019';
Date date2 = '08/03/2019';
date1.compareTo(date2);
Browser other questions tagged java
You are not signed in. Login or sign up in order to post.
The difference is 0:
date1 == date2
, 1:date1 > date2
, -1:date1 < date2
– Icaro Martins
Thank you very much.
– Paulo Gonçalves