About Question enthuware.ocpjp.v21.2.3791 :
Posted: Thu Feb 20, 2025 8:19 am
Hello,
this explanation is wrong imho here:
"date1.compare(date2) will return second date minus first date in seconds i.e. -3600, which, if converted to hours will be -1."
The code doesn't compare the dates, but the ZoneOffsets of these dates. That means -14400 seconds compareTo -18000 seconds = -3600 seconds which equals to -1 hour
this explanation is wrong imho here:
"date1.compare(date2) will return second date minus first date in seconds i.e. -3600, which, if converted to hours will be -1."
The code doesn't compare the dates, but the ZoneOffsets of these dates. That means -14400 seconds compareTo -18000 seconds = -3600 seconds which equals to -1 hour