Working with dates
Build a Date with Date.newInstance.
Your task
Use Apex date math on two month-end dates and print what changes.
Date yearEnd = null;
Date nextDay = null;
Boolean yearChanged = false;
Date monthEnd = null;
Date nextMonth = null;Requirements
addMonths(1)should be usedyear()should be useddaysBetweenshould be usedNext day: 2025-01-01 00:00:00should be printedYear changed: trueshould be printedNext month: 2025-02-28 00:00:00should be printedDays apart: 28should be printed