import java.util.Date;
Date firstDate;
I don't know how to initialize the firstDate
for example for String you say
String line1="First line"
but what is the format for date can you give me an example?
java.util.Date constructor with parameters like
new Date(int year, int month, int date, int hrs, int min).
is deprecated and preferably do not use it any more. Oracle documentation prefers the way over java.util.Calendar. So you can set any date and instantiate Date object through the getTime() method.
Calendar calendar = Calendar.getInstance();
calendar.set(2018, 11, 31, 59, 59, 59);
Date happyNewYearDate = calendar.getTime();
Notice that month number starts from 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With