You can use the Calendar method.
public static void main(String[] args) {
Calendar cal = Calendar.getInstance();
System.out.println(cal.get(Calendar.MONTH)+1+"Month");
System.out.println ("Last Day:"+cal.getMaximum(Calendar.DAY_OF_MONTH)));
}
where cal.getMaximum(Calendar.DAY_OF_MONTH) You can use it where you want it.
© 2024 OneMinuteCode. All rights reserved.