According to the Java API, the constructor Date(year, month, day)
is deprecated. I know that I can replace it with the following code:
Calendar myCa
Use the constructor Date(year,month,date)
in Java 8 it is deprecated:
Date date = new Date(1990, 10, 26, 0, 0);
The best way is to use SimpleDateFormat
DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
Date date = format.parse("26/10/1985");
you need to import import java.text.SimpleDateFormat;