import java.util.Date;
Date firstDate;
I don\'t know how to intialize the firstDate for example for String you say
String line1=\"Fir
Here's the Javadoc in Oracle's website for the Date class: https://docs.oracle.com/javase/8/docs/api/java/util/Date.html
If you scroll down to "Constructor Summary," you'll see the different options for how a Date object can be instantiated. Like all objects in Java, you create a new one with the following:
Date firstDate = new Date(ConstructorArgsHere);
Now you have a bit of a choice. If you don't pass in any arguments, and just do this,
Date firstDate = new Date();
it will represent the exact date and time at which you called it. Here are some other constructors you may want to make use of:
Date firstDate1 = new Date(int year, int month, int date);
Date firstDate2 = new Date(int year, int month, int date, int hrs, int min);
Date firstDate3 = new Date(int year, int month, int date, int hrs, int min, int sec);