According to the Java API, the constructor Date(year, month, day) is deprecated. I know that I can replace it with the following code:
Date(year, month, day)
Calendar myCa
You could use new GregorianCalendar(theYear, theMonth, theDay).getTime():
.getTime()
public GregorianCalendar(int year, int month, int dayOfMonth) Constructs a GregorianCalendar with the given date set in the default time zone with the default locale.
public GregorianCalendar(int year, int month, int dayOfMonth)
Constructs a GregorianCalendar with the given date set in the default time zone with the default locale.